summaryrefslogtreecommitdiffstats
path: root/Doc/library/tarfile.rst
diff options
context:
space:
mode:
authorStanley <46876382+slateny@users.noreply.github.com>2023-12-27 17:16:36 (GMT)
committerGitHub <noreply@github.com>2023-12-27 17:16:36 (GMT)
commit0651936ae2bc6999f488f8c519b8d07a06a11557 (patch)
tree3199097abe1b497474071a44ef9d276cd23a88f3 /Doc/library/tarfile.rst
parentc66b577d9f7a11ffab57985fd6fb22e9dfd4f245 (diff)
downloadcpython-0651936ae2bc6999f488f8c519b8d07a06a11557.zip
cpython-0651936ae2bc6999f488f8c519b8d07a06a11557.tar.gz
cpython-0651936ae2bc6999f488f8c519b8d07a06a11557.tar.bz2
gh-67641: Clarify documentation on bytes vs text with non-seeking tarfile stream (GH-31610)
Diffstat (limited to 'Doc/library/tarfile.rst')
-rw-r--r--Doc/library/tarfile.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index f4e83d6..7ba29d4 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -116,10 +116,12 @@ Some facts and figures:
``'filemode|[compression]'``. :func:`tarfile.open` will return a :class:`TarFile`
object that processes its data as a stream of blocks. No random seeking will
be done on the file. If given, *fileobj* may be any object that has a
- :meth:`~io.TextIOBase.read` or :meth:`~io.TextIOBase.write` method (depending on the *mode*). *bufsize*
- specifies the blocksize and defaults to ``20 * 512`` bytes. Use this variant
- in combination with e.g. ``sys.stdin``, a socket :term:`file object` or a tape
- device. However, such a :class:`TarFile` object is limited in that it does
+ :meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` method
+ (depending on the *mode*) that works with bytes.
+ *bufsize* specifies the blocksize and defaults to ``20 * 512`` bytes.
+ Use this variant in combination with e.g. ``sys.stdin.buffer``, a socket
+ :term:`file object` or a tape device.
+ However, such a :class:`TarFile` object is limited in that it does
not allow random access, see :ref:`tar-examples`. The currently
possible modes: