diff options
author | CAM Gerlach <CAM.Gerlach@Gerlach.CAM> | 2019-03-21 14:44:51 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-03-21 14:44:51 (GMT) |
commit | e680c3db80efc4a1d637dd871af21276db45ae03 (patch) | |
tree | 80df96129febac2d0a6bb1e8463f1785f96996ae /Doc | |
parent | ed5e29cba500c2336aacdb7c77953f1064235b72 (diff) | |
download | cpython-e680c3db80efc4a1d637dd871af21276db45ae03.zip cpython-e680c3db80efc4a1d637dd871af21276db45ae03.tar.gz cpython-e680c3db80efc4a1d637dd871af21276db45ae03.tar.bz2 |
bpo-36268: Change default tar format to pax from GNU. (GH-12355)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/tarfile.rst | 14 | ||||
-rw-r--r-- | Doc/whatsnew/3.8.rst | 10 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index 9cd0715..c7012a7 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -229,7 +229,11 @@ details. .. data:: DEFAULT_FORMAT - The default format for creating archives. This is currently :const:`GNU_FORMAT`. + The default format for creating archives. This is currently :const:`PAX_FORMAT`. + + .. versionchanged:: 3.8 + The default format for new archives was changed to + :const:`PAX_FORMAT` from :const:`GNU_FORMAT`. .. seealso:: @@ -820,8 +824,10 @@ There are three tar formats that can be created with the :mod:`tarfile` module: * The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible format with virtually no limits. It supports long filenames and linknames, large - files and stores pathnames in a portable way. However, not all tar - implementations today are able to handle pax archives properly. + files and stores pathnames in a portable way. Modern tar implementations, + including GNU tar, bsdtar/libarchive and star, fully support extended *pax* + features; some older or unmaintained libraries may not, but should treat + *pax* archives as if they were in the universally-supported *ustar* format. The *pax* format is an extension to the existing *ustar* format. It uses extra headers for information that cannot be stored otherwise. There are two flavours @@ -871,7 +877,7 @@ converted. Possible values are listed in section :ref:`error-handlers`. The default scheme is ``'surrogateescape'`` which Python also uses for its file system calls, see :ref:`os-filenames`. -In case of :const:`PAX_FORMAT` archives, *encoding* is generally not needed +For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not needed because all the metadata is stored using *UTF-8*. *encoding* is only used in the rare cases when binary pax headers are decoded or when strings with surrogate characters are stored. diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 2e311ab..18ec2c2 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -316,6 +316,16 @@ and manipulating normal distributions of a random variable. [7.672102882379219, 12.000027119750287, 4.647488369766392] +tarfile +------- + +The :mod:`tarfile` module now defaults to the modern pax (POSIX.1-2001) +format for new archives, instead of the previous GNU-specific one. +This improves cross-platform portability with a consistent encoding (UTF-8) +in a standardized and extensible format, and offers several other benefits. +(Contributed by C.A.M. Gerlach in :issue:`36268`.) + + tokenize -------- |