mal wrote:> > Ooh, very likely: > > >>> os.path.normpath('//5/foo/bar') > > '/5/foo/bar' > > > > Isn't // at the root a Unix convention of some sort for some > > network filesystems? Probably normpath() should just leave it alone. > > Samba uses //<hostname>/<mountname>/<path>. os.path.normpath() > should probably leave the leading '//' untouched (having too > many of those in the path doesn't do any harm, AFAIK). from 1.5.2's posixpath: def normpath(path): """Normalize path, eliminating double slashes, etc.""" import string # Treat initial slashes specially slashes = '' while path[:1] == '/': slashes = slashes + '/' path = path[1:] ... return slashes + string.joinfields(comps, '/') from 2.0's posixpath: def normpath(path): """Normalize path, eliminating double slashes, etc.""" if path == '': return '.' import string initial_slash = (path[0] == '/') ... if initial_slash: path = '/' + path return path or '.' interesting... Cheers /F
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4