Changeset 1462 for trunk/peppy/vfs/itools/uri/generic.py
- Timestamp:
- 07/07/08 07:41:10 (5 months ago)
- Files:
-
- 1 modified
-
trunk/peppy/vfs/itools/uri/generic.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/vfs/itools/uri/generic.py
r1026 r1462 738 738 scheme, authority, path, query, fragment = urlsplit(data) 739 739 740 # Some special cases for Windows paths 740 # Some special cases for Windows paths c:/a/b#4 and file:///c:/a/b#4. 741 # urlsplit has problems with the scheme, leading slashes in the path, 742 # and doesn't split out the fragment properly 741 743 if len(scheme) == 1: 742 744 # found a windows drive name instead of path, because urlsplit 743 745 # thinks the scheme is "c" for Windows paths like "c:/a/b" 746 if "#" in path: 747 # the fragment is improperly placed in the path 748 path, fragment = path.rsplit("#", 1) 744 749 path = "%s:%s" % (scheme, path) 745 750 scheme = "file" … … 748 753 # like "file:///c:/a/b" -- it thinks the path is "/c:/a/b", which 749 754 # to be correct requires removing the leading slash. 750 path = "%s:%s" % (path[1].lower(), path[3:]) 755 drive = path[1].lower() 756 path = path[3:] 757 if "#" in path: 758 path, fragment = path.rsplit("#", 1) 759 path = "%s:%s" % (drive, path) 751 760 752 761 # The path
