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
glob.glob inconsistent #45322
Comments
On windows, glob.glob gives different results if you use a wildcard or not and if you use unix-style paths. exemple : gives : the two first calls give the same result but one with a platform specific separator, and not the other. |
Hardly a show stopper. It's actually a problem(?) with ntpath.py. It could be patched but is it worth it, as this would be yet more work for you guys doing the build/release process? I'd close this on the grounds that it's not worth the effort. |
As no response to msg108627 I'll close this unless there are any objections. |
Some bugs take a long time to get fixed. I agree that three years is not a good score, but this really needs a test in order to get closed or fixed, so I’m reopening. Maybe the OP or you could add a test? :) |
Here is a test + patch, to preserve the separator. Of course this changes the current behaviour, like:
>>> glob.glob('/tmp/////foo*')
['/tmp/////foo1', '/tmp/////foo2'] |
The question is what result desirable for glob.glob("c:/tmp///3691674.jpg*"), ['c:/tmp///3691674.jpg'] or ['c:\\tmp\\3691674.jpg']? |
I have added some comments in Rietveld. |
Shell preserves the separators. Well, in any case we always can apply os.path.normpath() to result. |
Amaury, could you provide corrected patch? |
Ping. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: