util: url keeps backslash in paths

Backslashes (\) in paths were encoded to %C5 when converting from url to
string. This does not look nice for windows paths. And it introduces many
problems when running tests on windows.
This commit is contained in:
Simon Heimberg 2013-11-20 22:03:15 +01:00
parent 666578cf0e
commit 2143905ef7

View File

@ -1633,6 +1633,8 @@ class url(object):
<url path: '\\\\blah\\blah\\blah'>
>>> url(r'\\blah\blah\blah#baz')
<url path: '\\\\blah\\blah\\blah', fragment: 'baz'>
>>> url(r'file:///C:\users\me')
<url scheme: 'file', path: 'C:\\users\\me'>
Authentication credentials:
@ -1650,7 +1652,7 @@ class url(object):
"""
_safechars = "!~*'()+"
_safepchars = "/!~*'()+:"
_safepchars = "/!~*'()+:\\"
_matchscheme = re.compile(r'^[a-zA-Z0-9+.\-]+:').match
def __init__(self, path, parsequery=True, parsefragment=True):
@ -1787,6 +1789,8 @@ class url(object):
'file:///c:/tmp/foo/bar'
>>> print url(r'bundle:foo\bar')
bundle:foo\bar
>>> print url(r'file:///D:\data\hg')
file:///D:\data\hg
"""
if self._localpath:
s = self.path