-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-112578: Fix RuntimeWarning when running zipfile #112579
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
|
Hmm, actually |
|
Can we test this somehow to prevent future regressions? |
| ) | ||
|
|
||
| # used privately for tests | ||
| from .__main__ import main # noqa: F401, E402 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simply remove this import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I did initially (see first commit). But I want to backport this change and I got worried because zipfile.main has existed for 15 years and that comment has only existed for one year.
I found one use in the wild too: https://github.com/ThoreBor/Anki_Leaderboard/blob/master/tools/ankiaddon.py
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
Thanks @hauntsaninja for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
GH-112646 is a backport of this pull request to the 3.12 branch. |
…2579) (cherry picked from commit 29e6c7b) Co-authored-by: Shantanu <[email protected]>
|
I agree, this is the right solution. |
…GH-112646) (cherry picked from commit 29e6c7b) Co-authored-by: Shantanu <[email protected]>
jaraco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
python -m zipfileissues RuntimeWarning #112578