diff options
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/tarfile.py | 2 | ||||
-rw-r--r-- | Lib/test/test_tarfile.py | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index bb09d10..30cecff 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -105,7 +105,7 @@ SOLARIS_XHDTYPE = b"X" # Solaris extended header USTAR_FORMAT = 0 # POSIX.1-1988 (ustar) format GNU_FORMAT = 1 # GNU tar format PAX_FORMAT = 2 # POSIX.1-2001 (pax) format -DEFAULT_FORMAT = GNU_FORMAT +DEFAULT_FORMAT = PAX_FORMAT #--------------------------------------------------------- # tarfile constants diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 5e5a3c3..7e32cbc 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -2136,15 +2136,16 @@ class MiscTest(unittest.TestCase): def test_write_number_fields(self): self.assertEqual(tarfile.itn(1), b"0000001\x00") self.assertEqual(tarfile.itn(0o7777777), b"7777777\x00") - self.assertEqual(tarfile.itn(0o10000000), + self.assertEqual(tarfile.itn(0o10000000, format=tarfile.GNU_FORMAT), b"\x80\x00\x00\x00\x00\x20\x00\x00") - self.assertEqual(tarfile.itn(0xffffffff), + self.assertEqual(tarfile.itn(0xffffffff, format=tarfile.GNU_FORMAT), b"\x80\x00\x00\x00\xff\xff\xff\xff") - self.assertEqual(tarfile.itn(-1), + self.assertEqual(tarfile.itn(-1, format=tarfile.GNU_FORMAT), b"\xff\xff\xff\xff\xff\xff\xff\xff") - self.assertEqual(tarfile.itn(-100), + self.assertEqual(tarfile.itn(-100, format=tarfile.GNU_FORMAT), b"\xff\xff\xff\xff\xff\xff\xff\x9c") - self.assertEqual(tarfile.itn(-0x100000000000000), + self.assertEqual(tarfile.itn(-0x100000000000000, + format=tarfile.GNU_FORMAT), b"\xff\x00\x00\x00\x00\x00\x00\x00") # Issue 32713: Test if itn() supports float values outside the |