summaryrefslogtreecommitdiffstats
path: root/Doc/library/tarfile.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/tarfile.rst')
-rw-r--r--Doc/library/tarfile.rst18
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index b617796..d5a511e 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -66,8 +66,8 @@ Some facts and figures:
*mode* ``'r'`` to avoid this. If a compression method is not supported,
:exc:`CompressionError` is raised.
- If *fileobj* is specified, it is used as an alternative to a file object opened
- for *name*. It is supposed to be at position 0.
+ If *fileobj* is specified, it is used as an alternative to a :term:`file object`
+ opened in binary mode for *name*. It is supposed to be at position 0.
For special purposes, there is a second format for *mode*:
``'filemode|[compression]'``. :func:`tarfile.open` will return a :class:`TarFile`
@@ -75,7 +75,7 @@ Some facts and figures:
be done on the file. If given, *fileobj* may be any object that has a
:meth:`read` or :meth:`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 file object or a tape
+ 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
not allow to be accessed randomly, see :ref:`tar-examples`. The currently
possible modes:
@@ -344,9 +344,9 @@ object, see :ref:`tarinfo-objects` for details.
.. method:: TarFile.extractfile(member)
Extract a member from the archive as a file object. *member* may be a filename
- or a :class:`TarInfo` object. If *member* is a regular file, a file-like object
- is returned. If *member* is a link, a file-like object is constructed from the
- link's target. If *member* is none of the above, :const:`None` is returned.
+ or a :class:`TarInfo` object. If *member* is a regular file, a :term:`file-like
+ object` is returned. If *member* is a link, a file-like object is constructed from
+ the link's target. If *member* is none of the above, :const:`None` is returned.
.. note::
@@ -380,9 +380,9 @@ object, see :ref:`tarinfo-objects` for details.
.. method:: TarFile.gettarinfo(name=None, arcname=None, fileobj=None)
- Create a :class:`TarInfo` object for either the file *name* or the file object
- *fileobj* (using :func:`os.fstat` on its file descriptor). You can modify some
- of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`.
+ Create a :class:`TarInfo` object for either the file *name* or the :term:`file
+ object` *fileobj* (using :func:`os.fstat` on its file descriptor). You can modify
+ some of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`.
If given, *arcname* specifies an alternative name for the file in the archive.