[New-bugs-announce] [issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive

Nick Coghlan report at bugs.python.org
Tue Jun 13 21:25:39 EDT 2017


New submission from Nick Coghlan:

shutil.make_archive currently just uses the default tar format, which is GNU_FORMAT.

This format doesn't ensure that all character paths are encoded as UTF-8, and hence may end up embedding platform specific encoding assumptions into the generated tarball.

I see a few possible ways of resolving this:

1. Change the default tar format to PAX_FORMAT. It's been 16 years since that was defined, and Python itself has supported it since 2.6 was released in 2008, so perhaps we can rely on other tools supporting it now? (My main open question on that front would be "What happens if you specify "format=GNU_FORMAT" when attempting to read a PAX formatted archive?)

2. Add new shutil level "pax", "gzpax", "bzpax", "xzpax" format definitions to explicitly request PAX_FORMAT

3. Add a mechanism to shutil.make_archive that allows format-dependent settings to be based down to the underlying archive creation functions (e.g. "format=tarfile.PAX_FORMAT").

----------
messages: 295974
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Support tarfile.PAX_FORMAT in shutil.make_archive
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30661>
_______________________________________


More information about the New-bugs-announce mailing list