]> granicus.if.org Git - python/commit
Issue #8633: Support for POSIX.1-2008 binary pax headers.
authorLars Gustäbel <lars@gustaebel.de>
Mon, 17 May 2010 18:02:50 +0000 (18:02 +0000)
committerLars Gustäbel <lars@gustaebel.de>
Mon, 17 May 2010 18:02:50 +0000 (18:02 +0000)
commit1465cc2887be2054cca50c72ef804adcc15fdf65
tree3f20bc90a15488fcbca7868415cf35d2bc1e114a
parent0f78a94f445c48f5a96a77a1bb77ca88d7c50694
Issue #8633: Support for POSIX.1-2008 binary pax headers.

tarfile is now able to read and write pax headers with a
"hdrcharset=BINARY" record. This record was introduced in
POSIX.1-2008 as a method to store unencoded binary strings that
cannot be translated to UTF-8. In practice, this is just a workaround
that allows a tar implementation to store filenames that do not
comply with the current filesystem encoding and thus cannot be
decoded correctly.
Additionally, tarfile works around a bug in current versions of GNU
tar: undecodable filenames are stored as-is in a pax header without a
"hdrcharset" record being added. Technically, these headers are
invalid, but tarfile manages to read them correctly anyway.
Doc/library/tarfile.rst
Lib/tarfile.py
Lib/test/test_tarfile.py
Lib/test/testtar.tar
Misc/NEWS