summaryrefslogtreecommitdiff
path: root/Doc/library
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2013-12-08 19:47:22 +0100
committerNadeem Vawda <nadeem.vawda@gmail.com>2013-12-08 19:47:22 +0100
commit84a466934ffef9c813aa0df2214c3907692c9533 (patch)
treec9cc70dddb5739931a529632a312014c081bf6da /Doc/library
parent23a45a46902515a466c23c541b0ebb5c7308c3c4 (diff)
downloadcpython-84a466934ffef9c813aa0df2214c3907692c9533.tar.gz
#18430: Document that peek() may change the position of the underlying file for
the BZ2File, GzipFile and LZMAFile classes.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/bz2.rst5
-rw-r--r--Doc/library/gzip.rst5
-rw-r--r--Doc/library/lzma.rst5
3 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst
index 95a5abb75d..b79bccdb31 100644
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -91,6 +91,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
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
.. versionchanged:: 3.1
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index ec16f6ae88..354deed921 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -113,6 +113,11 @@ The module defines the following items:
the call. The number of bytes returned may be more or less than
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
.. versionchanged:: 3.1
diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst
index da4657551e..07b69eb772 100644
--- a/Doc/library/lzma.rst
+++ b/Doc/library/lzma.rst
@@ -98,6 +98,11 @@ Reading and writing compressed files
byte of data will be returned, unless EOF has been reached. The exact
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*).
+
Compressing and decompressing data in memory
--------------------------------------------