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

Windows path root separator is normalized #29

Closed
ThakeeNathees opened this issue May 29, 2022 · 3 comments
Closed

Windows path root separator is normalized #29

ThakeeNathees opened this issue May 29, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ThakeeNathees
Copy link

Hi, thanks for making this library, I've been using it for my side project pocketlang.

On windows cwk_path_normalize does not seems to change the path separator of the root from / to \\ (An example provided below). Is this behavior intended or should be patched?

>>> import path
>>> path.normpath('foo/bar/baz')
"foo\\bar\\baz"
>>> path.normpath('C:/foo/bar/baz')
"C:/foo\\bar\\baz"

cwk_path_get_relative also seems to fail because of the separator of the root

>>> path.relpath('C:\\foo/bar/file.txt', 'C:\\foo\\bar\\baz\\')
"..\\file.txt"
>>> path.relpath('C:/foo/bar/file.txt', 'C:\\foo\\bar\\baz\\')
""
@likle likle self-assigned this May 29, 2022
@likle likle added the bug Something isn't working label May 29, 2022
@likle
Copy link
Owner

likle commented May 29, 2022

Hi @ThakeeNathees ! Thanks for reporting this bug, I will have a look at it.

@likle
Copy link
Owner

likle commented May 29, 2022

Hi @ThakeeNathees ! I have made changes in the master branch. Would you like to give me some feedback whether this works better for you?

@ThakeeNathees
Copy link
Author

@likle yup it works well and wow that was fast, thanks again. I'm closing this issue as it's resolved.

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

No branches or pull requests

2 participants