-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Avoid using private function glob.glob1() in msi module and tools #60824
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
Comments
Private function glob.glob1() used in Lib/msilib and Tools/msi to prevent unexpected globbing in parent directory name. |
I have added some comments on Rietveld. Note that glob.glob() and glob.glob1() returns different filenames. The first returns full paths and the second returns bare filenames without a directory path. Workarounding this may require more in-depth changes to the code. Actually this is a low priority issue. It is no so bad to use private functions from other modules inside Python stdlib. But it can be a bad example for a third party code. |
Just a reminder that there are comments on Rietveld. |
Martin, this patch touches some of your code. Do you care to take a look at it? |
For now there is only one place left that uses glob1(). Here is a patch that inlines glob1() in that place. |
The patch for bpo-25596 removes glob1(), so we should get rid of its usage. |
It looks to me that the glob() method of msilib.Directory is broken from the born. It uses the function from the glob module, but the glob module is not imported in this source file. Even if add missed import, returned value is incorrect in Python 3. In Python 2 glob.glob1() always returned a list, but in in Python 3 it can return an empty list or an iterator. After iterating on it msilib.Directory returns an empty list or exhausted iterator. |
New changeset 652a50208e89 by Serhiy Storchaka in branch '3.5': New changeset 158ae15f5809 by Serhiy Storchaka in branch '2.7': New changeset 84a50f14a266 by Serhiy Storchaka in branch 'default': New changeset f2586c381b0b by Serhiy Storchaka in branch 'default': |
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: