* gh-135276: Refresh `zipfile.Path` from zipp 3.23 (GH-135277)
Apply changes from zipp 3.23
(cherry picked from commit 8d6eb0c262)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Removed features slated for Python 3.15 only.
---------
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
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.