mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merge with 3.4: Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
This commit is contained in:
commit
49c521fd5d
3 changed files with 9 additions and 1 deletions
|
@ -1952,6 +1952,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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue