Author CAM-Gerlach
Recipients CAM-Gerlach, docs@python, ncoghlan
Date 2019-03-30.18:47:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I opened a PR to implement both those changes, and also added some minor related clarifications and fixes to the format section of the tarfile docs.

> how tarfile.Tarfile behaves if you tell it to open a PAX_FORMAT archive using GNU_FORMAT or vice-versa

I tested tarfile.Tarfile() and extract_all() on the resulting object with several different simple- to moderately-complex (including Unicode filenames) real-world pax- and GNU-format archives packed with different archivers, with both format=GNU_FORMAT and format=PAX_FORMAT for each one, got no warnings or errors with debug=3 and errorlevel=2, and extraction was successful and yielded identical results for either format argument, and did not get a PAXHEADERS file output for either one. Furthermore, tracing the code, its not clear that Tarfile() (with 'r') and extract, etc. use the passed `format`.

Even if so, in order to produce an error after this change but not before, all of the following would seem to have to be the case:

* The tarfile being read would have to be in GNU format, i.e. from an external source or produced with an older version of Python
* The tarfile would have to make use of specific extended/non-standard GNU tar features not tested above
* The user would have to use Tarfile() to open the tarfile, rather than one of the other, more common/higher-level methods
* The user's call to Tarfile() would have to have used DEFAULT_FORMAT rather than being explicitly specified. and implicitly relied DEFAULT_FORMAT == GNU_FORMAT

Therefore, this seems like a very specific corner-case. However, if you think I should include it, I'll go ahead with it. Also, let me know if these doc changes should have a separate NEWS entry or the previous one adequately covers it.
Date User Action Args
2019-03-30 18:47:13CAM-Gerlachsetrecipients: + CAM-Gerlach, ncoghlan, docs@python
2019-03-30 18:47:13CAM-Gerlachsetmessageid: <>
2019-03-30 18:47:13CAM-Gerlachlinkissue30661 messages
2019-03-30 18:47:13CAM-Gerlachcreate