Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…126576) (#126642) gh-126565: Skip `zipfile.Path.exists` check in write mode (GH-126576) When `zipfile.Path.open` is called, the implementation will check whether the path already exists in the ZIP file. However, this check is only required when the ZIP file is in read mode. By swapping arguments of the `and` operator, the short-circuiting will prevent the check from being run in write mode. This change will improve the performance of `open()`, because checking whether a file exists is slow in write mode, especially when the archive has many members. (cherry picked from commit 160758a) Co-authored-by: Jan Hicken <janhicken@users.noreply.github.com>
- Loading branch information