diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-29 10:34:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 10:34:11 -0600 |
commit | 0aeab5c4381f0cc11479362af2533b3a391312ac (patch) | |
tree | 11f53305312285e0bd7a911dc883294d9f73bef0 /Doc/library | |
parent | 1f0cd3c61a5ae3aac5ebaccc75ae9828ca4f96c4 (diff) | |
download | cpython-git-0aeab5c4381f0cc11479362af2533b3a391312ac.tar.gz |
bpo-39667: Sync zipp 3.0 (GH-18540)
* bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0
* 📜🤖 Added by blurb_it.
* Update docs for new zipfile.Path.open
* Rely on dict, faster than OrderedDict.
* Syntax edits on docs
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/zipfile.rst | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index e8a2530fb8..7126d8bd70 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -489,10 +489,20 @@ Path objects are traversable using the ``/`` operator. The final path component. -.. method:: Path.open(*, **) - - Invoke :meth:`ZipFile.open` on the current path. Accepts - the same arguments as :meth:`ZipFile.open`. +.. method:: Path.open(mode='r', *, pwd, **) + + Invoke :meth:`ZipFile.open` on the current path. + Allows opening for read or write, text or binary + through supported modes: 'r', 'w', 'rb', 'wb'. + Positional and keyword arguments are passed through to + :class:`io.TextIOWrapper` when opened as text and + ignored otherwise. + ``pwd`` is the ``pwd`` parameter to + :meth:`ZipFile.open`. + + .. versionchanged:: 3.9 + Added support for text and binary modes for open. Default + mode is now text. .. method:: Path.iterdir() |