Skip to content
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

relative_to doesn't work for FilePath #214

Open
Tracked by #223
CompRhys opened this issue Apr 15, 2024 · 2 comments · May be fixed by #215
Open
Tracked by #223

relative_to doesn't work for FilePath #214

CompRhys opened this issue Apr 15, 2024 · 2 comments · May be fixed by #215
Assignees
Labels
bug Something isn't working

Comments

@CompRhys
Copy link

CompRhys commented Apr 15, 2024

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:https:///usr/file.txt')
>>> a.is_relative_to(b)
True
>>> a.relative_to(b)
FilePath('file:https:///Users/chemix-rhys/usr/file.txt')
True

The relative_to method appears to be broken for FilePath

@CompRhys
Copy link
Author

potentially related issues: #170 #184

@CompRhys CompRhys linked a pull request Apr 15, 2024 that will close this issue
@ap--
Copy link
Collaborator

ap-- commented Apr 16, 2024

Hi @CompRhys

Thank you for reporting the issue and thank you for wanting to contribute ❤️

The relative_to and is_relative_to handling is indeed broken, for basically all UPath types.

I'll review your PR right away.

Cheers,
Andreas

@ap-- ap-- added the bug Something isn't working label Apr 16, 2024
@ap-- ap-- mentioned this issue Jun 14, 2024
12 tasks
@ap-- ap-- self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants