-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
gh-112578: Fix RuntimeWarning when running zipfile #112579
Conversation
Hmm, actually |
Can we test this somehow to prevent future regressions? |
from ._path import ( # noqa: E402 | ||
Path, | ||
|
||
# used privately for tests | ||
CompleteDirs, # noqa: F401 | ||
) | ||
|
||
# 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
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. |
I agree, this is the right solution. |
…GH-112646) (cherry picked from commit 29e6c7b) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
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 zipfile
issues RuntimeWarning #112578