-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove trailing os.sep to avoid false negatives #5293
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
Conversation
There is no test for this? |
No, there isn't, sorry. Please let me know if you want me to write it. |
As a simpler step, rather than only trying to test |
Yes, please do. :) |
I have created the test on #5325 |
Note: if it is at all possible to install scripts in the root folder of a file system, this might break. Using |
The documentation does mention an issue with symbolic paths in Unix. Perhaps we should only remove the trailing os.sep in Windows and if not os.path.normpath(i).endswith(os.sep) ? This won't remove it in "C:\". |
I like that! This seems to work: I'm not doing the |
I can add unit tests for this if you want. I would need some pointers on how to get the unit tests rolling though (currently getting |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When we look the dirs in PATH, we don't remove the trailing os.sep, and since we are using a set to do the checking, we get false negatives.
Example: