-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-112998: zipfile: fix extractall makedirs race condition #112966
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
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
dc3f81e to
ca20b8e
Compare
ca20b8e to
5e81a45
Compare
| if not os.path.isdir(targetpath): | ||
| os.mkdir(targetpath) | ||
| try: | ||
| os.mkdir(targetpath) | ||
| except FileExistsError: | ||
| pass |
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.
Currently it raises FileExistsError if targetpath exists, but is not a directory. With this change it will be silent. It is not good, because it is an error.
Please add a test for extracting a directory in place of existing regular file.
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.
Such test was added in #114960, and it fails with this PR.
This should fix it
zipfileextractall is not multi-threading safe #112998