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

Fix absolute path detection with empty path components. #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

will-ca
Copy link

@will-ca will-ca commented Mar 1, 2023

Fixes #27.

Untested. But should be simple enough.

https://docs.python.org/3/library/os.path.html#os.path.abspath https://docs.python.org/3/library/os.path.html#os.path.normpath

Note Python docs explicitly specify that abspath() usually includes a transform that is equivalent to normpath.

Perhaps also note comment in Python docs that this "may change the meaning of a path that contains symbolic links".

…Actually, why is it .startswith() instead of ==, or even just .startswith('/')— or path.isabs()— anyway?

Fixes elan-ev#27.

Untested. But should be simple enough.

https://docs.python.org/3/library/os.path.html#os.path.abspath
https://docs.python.org/3/library/os.path.html#os.path.normpath

Note Python docs explicitly specify that `abspath()` usually includes a transform that is equivalent to `normpath`.

Perhaps also note comment in Python docs that this "may change the meaning of a path that contains symbolic links".

…Actually, why is it `.startswith()` instead of `==`, or even just `.startswith('/')`— or `path.isabs()`— anyway?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant