diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2015-07-02 17:38:38 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2015-07-02 17:38:38 (GMT) |
commit | b7a688b3a40705ab4f7f7035d40ec026899c7052 (patch) | |
tree | c61e60f49ff4a846603bbe805b1fb73c70d9be13 /Lib/test | |
parent | 3ef80587f01af27427fc1fcc05d8fd1726edd23d (diff) | |
download | cpython-b7a688b3a40705ab4f7f7035d40ec026899c7052.zip cpython-b7a688b3a40705ab4f7f7035d40ec026899c7052.tar.gz cpython-b7a688b3a40705ab4f7f7035d40ec026899c7052.tar.bz2 |
Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tarfile.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index c135304..5b55e07 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -1842,6 +1842,10 @@ class MiscTest(unittest.TestCase): self.assertEqual(tarfile.nti(b"\xff\x00\x00\x00\x00\x00\x00\x00"), -0x100000000000000) + # Issue 24514: Test if empty number fields are converted to zero. + self.assertEqual(tarfile.nti(b"\0"), 0) + self.assertEqual(tarfile.nti(b" \0"), 0) + def test_write_number_fields(self): self.assertEqual(tarfile.itn(1), b"0000001\x00") self.assertEqual(tarfile.itn(0o7777777), b"7777777\x00") |