Skip to content

relative_to doesn't work for FilePath #214

Open
@CompRhys

Description

@CompRhys
Python 3.10.11 | packaged by conda-forge | (main, May 10 2023, 19:07:22) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import upath
>>> upath.__version__
'0.2.2'
>>> a = upath.UPath("/usr")
>>> b = upath.UPath("/")
>>> a.is_relative_to(b)
True
>>> a.relative_to(b)
PosixUPath('usr')
>>> a = upath.implementations.local.FilePath('file:///usr/file.txt')
>>> a.is_relative_to(b)
True
>>> a.relative_to(b)
FilePath('file:///Users/chemix-rhys/usr/file.txt')
True

The relative_to method appears to be broken for FilePath

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions