gruns / furl

🌐 URL parsing and manipulation made easy.
Other
2.6k stars 151 forks source link

Loosing absolute path on assignation #144

Open rsemlal opened 3 years ago

rsemlal commented 3 years ago

Hello,

When playing with file://uris I found a weird behaviour related to path setter.

Steps to reproduce

>>> x = furl('file:///a/b')
>>> x.path
Path('/a/b')
>>> x.path.isabsolute # The path here is absolute and is ok
True
>>> x.path = x.path / 'c'
>>> x.path  # Once set to the path attribute of a furl object the path is not absolute anymore
Path('a/b/c')
>>> x.path.isabsolute 
False

Additional info & workaround

This problem does not happen whan assigning a path as a string

>>> x = furl('file:///a/b')
>>> x.path = str(x.path / 'c')
>>> x.path 
Path('/a/b/c')
>>> x.path.isabsolute 
True

Expected behaviour

The concatenation of a path segment should not change the way the path interpreted

gruns commented 3 years ago

definitely looks like a bug! great find!

do you have time to dig into this and open a PR to fix it?