mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Closes #18430: Document that peek() may change the position of the underlying
file for the BZ2File, GzipFile and LZMAFile classes.
This commit is contained in:
commit
bd6932a576
3 changed files with 15 additions and 0 deletions
|
@ -95,6 +95,11 @@ All of the classes in this module may safely be accessed from multiple threads.
|
||||||
byte of data will be returned (unless at EOF). The exact number of bytes
|
byte of data will be returned (unless at EOF). The exact number of bytes
|
||||||
returned is unspecified.
|
returned is unspecified.
|
||||||
|
|
||||||
|
.. note:: While calling :meth:`peek` does not change the file position of
|
||||||
|
the :class:`BZ2File`, it may change the position of the underlying file
|
||||||
|
object (e.g. if the :class:`BZ2File` was constructed by passing a file
|
||||||
|
object for *filename*).
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
|
|
|
@ -117,6 +117,11 @@ The module defines the following items:
|
||||||
the call. The number of bytes returned may be more or less than
|
the call. The number of bytes returned may be more or less than
|
||||||
requested.
|
requested.
|
||||||
|
|
||||||
|
.. note:: While calling :meth:`peek` does not change the file position of
|
||||||
|
the :class:`GzipFile`, it may change the position of the underlying
|
||||||
|
file object (e.g. if the :class:`GzipFile` was constructed with the
|
||||||
|
*fileobj* parameter).
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
|
|
|
@ -102,6 +102,11 @@ Reading and writing compressed files
|
||||||
byte of data will be returned, unless EOF has been reached. The exact
|
byte of data will be returned, unless EOF has been reached. The exact
|
||||||
number of bytes returned is unspecified (the *size* argument is ignored).
|
number of bytes returned is unspecified (the *size* argument is ignored).
|
||||||
|
|
||||||
|
.. note:: While calling :meth:`peek` does not change the file position of
|
||||||
|
the :class:`LZMAFile`, it may change the position of the underlying
|
||||||
|
file object (e.g. if the :class:`LZMAFile` was constructed by passing a
|
||||||
|
file object for *filename*).
|
||||||
|
|
||||||
.. versionchanged:: 3.4
|
.. versionchanged:: 3.4
|
||||||
Added support for the ``"x"`` and ``"xb"`` modes.
|
Added support for the ``"x"`` and ``"xb"`` modes.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue