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

All logic relying on os.path.sep is wrong on Windows #314

Open
RunDevelopment opened this issue Feb 2, 2024 · 2 comments
Open

All logic relying on os.path.sep is wrong on Windows #314

RunDevelopment opened this issue Feb 2, 2024 · 2 comments
Labels
bug for issue

Comments

@RunDevelopment
Copy link

Provide environment information

Python: 3.8.2
gdown: main

What OS are you using?

Windows 10

Describe the Bug

All the logic using os.path.sep is incorrect on Windows, because Windows paths treat / the same as a \. However, gdown only uses os.path.sep (which is \ on Windows) meaning that it treats perfectly valid paths incorrectly.

The underlying issue is that gdown assumes that the primary path separator is the only path separator, which is not true.

Example of an incorrect usage of os.path.sep to detect directory paths.

Expected Behavior

Support paths with both / and \ on Windows.

To Reproduce

No response

@RunDevelopment RunDevelopment added the bug for issue label Feb 2, 2024
@wkentaro
Copy link
Owner

wkentaro commented Feb 3, 2024

@RunDevelopment I don't own Windows computer so am not able to play around the difference of / and \. Can you propose a fix for it as a PR?

@RunDevelopment
Copy link
Author

As I see it, #313 needs to be fixed before I can propose a fix. You just said that you have no way to verify that any fix I propose works. So there should at least be a test so a Windows CI runner can verify that my fix is correct.

So I'm currently working on #313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug for issue
Projects
None yet
Development

No branches or pull requests

2 participants