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
Different glob() results for strings and bytes #60822
Comments
glob ignores names which starts with dot if pattern is not starts with dot. But this is wrong for bytes pattern in Python 3. >>> import glob
>>> glob.glob('*hg')
[]
>>> glob.glob(b'*hg')
[b'.hg'] The proposed patch fixes this inconsistency. Also it contains new tests for this and some other possible cases. |
Python 2.7 is not needed the fix, however additional tests can be useful. Here is a patch. |
See also bpo-16696. |
The patch doesn't apply cleanly. |
Patches updated to resolve conflicts with recent commits. Some minor test |
Patches updated. Unrelated changes removed. |
Yet one attempt. |
Serhiy, are you going to update your patches? I can implement the feedback of our Q4 Community Service Award awardee too in case you’re busy. |
Aha! It's OS/2 where glob('*/') returns result without trailing slash. Here also glob() can return str (on 2.7) result for unicode pattern. |
Here is an updated patches. I hope it satisfies Antoine's comments. |
New changeset 62f67a52b0c2 by Hynek Schlawack in branch '3.2': New changeset fa8c4f96d990 by Hynek Schlawack in branch '3.3': New changeset eae2a42603ee by Hynek Schlawack in branch 'default': New changeset 44609ff7e53c by Hynek Schlawack in branch '2.7': |
Thanks Serhiy! |
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: