summaryrefslogtreecommitdiff
path: root/Doc/library
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-01-16 15:33:30 +0100
committerGitHub <noreply@github.com>2020-01-16 15:33:30 +0100
commit9baf242fc733ab8a52a0b6201d95c6fdb8251745 (patch)
treef0ae86e8fcf1e85373a3fe8aba790e6266950359 /Doc/library
parentc5b79003f5fe6aa28a2a028680367839ba8677db (diff)
downloadcpython-git-9baf242fc733ab8a52a0b6201d95c6fdb8251745.tar.gz
bpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)
Remove the buffering parameter of bz2.BZ2File. Since Python 3.0, it was ignored and using it was emitting a DeprecationWarning. Pass an open file object to control how the file is opened. The compresslevel parameter becomes keyword-only.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/bz2.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst
index aa836af2b2..85cdc16a7d 100644
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -65,7 +65,7 @@ All of the classes in this module may safely be accessed from multiple threads.
Accepts a :term:`path-like object`.
-.. class:: BZ2File(filename, mode='r', buffering=None, compresslevel=9)
+.. class:: BZ2File(filename, mode='r', *, compresslevel=9)
Open a bzip2-compressed file in binary mode.
@@ -81,8 +81,6 @@ All of the classes in this module may safely be accessed from multiple threads.
If *filename* is a file object (rather than an actual file name), a mode of
``'w'`` does not truncate the file, and is instead equivalent to ``'a'``.
- The *buffering* argument is ignored. Its use is deprecated since Python 3.0.
-
If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between
``1`` and ``9`` specifying the level of compression: ``1`` produces the
least compression, and ``9`` (default) produces the most compression.
@@ -110,9 +108,6 @@ All of the classes in this module may safely be accessed from multiple threads.
.. versionadded:: 3.3
- .. deprecated:: 3.0
- The keyword argument *buffering* was deprecated and is now ignored.
-
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added.
@@ -138,6 +133,13 @@ All of the classes in this module may safely be accessed from multiple threads.
.. versionchanged:: 3.6
Accepts a :term:`path-like object`.
+ .. versionchanged:: 3.9
+ The *buffering* parameter has been removed. It was ignored and deprecated
+ since Python 3.0. Pass an open file object to control how the file is
+ opened.
+
+ The *compresslevel* parameter became keyword-only.
+
Incremental (de)compression
---------------------------