mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Correct information about the tarfile module.
This commit is contained in:
parent
3134f14b1a
commit
5576091fc7
1 changed files with 8 additions and 8 deletions
|
@ -2453,18 +2453,18 @@ changes, or look through the Subversion logs for all the details.
|
||||||
by calling :func:`sys.getprofile` and :func:`sys.gettrace`.
|
by calling :func:`sys.getprofile` and :func:`sys.gettrace`.
|
||||||
(Contributed by Georg Brandl; :issue:`1648`.)
|
(Contributed by Georg Brandl; :issue:`1648`.)
|
||||||
|
|
||||||
* The :mod:`tarfile` module now supports POSIX.1-2001 (pax) and
|
* The :mod:`tarfile` module now supports POSIX.1-2001 (pax) tarfiles in
|
||||||
POSIX.1-1988 (ustar) format tarfiles, in addition to the GNU tar
|
addition to the POSIX.1-1988 (ustar) and GNU tar formats that were
|
||||||
format that was already supported. The default format
|
already supported. The default format is GNU tar; specify the
|
||||||
is GNU tar; specify the ``format`` parameter to open a file
|
``format`` parameter to open a file using a different format::
|
||||||
using a different format::
|
|
||||||
|
|
||||||
tar = tarfile.open("output.tar", "w",
|
tar = tarfile.open("output.tar", "w",
|
||||||
format=tarfile.PAX_FORMAT)
|
format=tarfile.PAX_FORMAT)
|
||||||
|
|
||||||
The new ``errors`` parameter specifies an error handling scheme for
|
The new ``encoding`` and ``errors`` parameters specify an encoding and
|
||||||
character conversions. ``'strict'``, ``'ignore'``, and
|
an error handling scheme for character conversions. ``'strict'``,
|
||||||
``'replace'`` are the three standard ways Python can handle errors,;
|
``'ignore'``, and ``'replace'`` are the three standard ways Python can
|
||||||
|
handle errors,;
|
||||||
``'utf-8'`` is a special value that replaces bad characters with
|
``'utf-8'`` is a special value that replaces bad characters with
|
||||||
their UTF-8 representation. (Character conversions occur because the
|
their UTF-8 representation. (Character conversions occur because the
|
||||||
PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)
|
PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue