-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if path end with "/", then add one path start with "/" will become "//" #145
Comments
this isn't an outright bug, as >>> f = furl()
>>> f.path = 'a////b'
>>> f.url
'a////b' if you want to remove the back to back >>> from furl import furl
>>> f = furl('https://www.baidu.com/aaa//bbbb/ccc')
>>> f.path.normalize()
>>> f.url
'https://www.baidu.com/aaa/bbbb/ccc' does |
Hello @gruns , can we have a parameter for For me it is okay to store internally everything not normalized, but I would like to get at the end normalized path/url. Another question is, can we support the settings on current solution: f = furl(url='https://example.com/hello/' / some_var_path / '/')
f.path.normalize()
return f.url It looks so unnatural and instead of 1 line I should write 3 lines to make sure I do not have double slashes and also I do have trailing slash (see this It would be great like: return furl(url='https://example.com/hello/' / some_var_path, normalize=True, trailing_slash=True).url |
In [2]: u = furl("https://www.baidu.com/aaa") / "/bbbb/ccc"
In [3]: u.url
Out[3]: 'https://www.baidu.com/aaa/bbbb/ccc'
In [4]: u = furl("https://www.baidu.com/aaa/") / "/bbbb/ccc"
In [6]: u.url
Out[6]: 'https://www.baidu.com/aaa//bbbb/ccc'
The text was updated successfully, but these errors were encountered: