summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2015-07-02 19:41:03 +0200
committerLars Gustäbel <lars@gustaebel.de>2015-07-02 19:41:03 +0200
commit49c521fd5d3102916045551019368eae66dc7696 (patch)
treeb51dc93916098c3c58bf9c89807341c2f499bdc0 /Lib/tarfile.py
parent44f323cb42418e6e2b83b7655146de66a7289dd4 (diff)
parentb7a688b3a40705ab4f7f7035d40ec026899c7052 (diff)
downloadcpython-git-49c521fd5d3102916045551019368eae66dc7696.tar.gz
Merge with 3.4: Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-xLib/tarfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index bf2234f637..d1279d2bf5 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -178,7 +178,8 @@ def nti(s):
n = -(256 ** (len(s) - 1) - n)
else:
try:
- n = int(nts(s, "ascii", "strict") or "0", 8)
+ s = nts(s, "ascii", "strict")
+ n = int(s.strip() or "0", 8)
except ValueError:
raise InvalidHeaderError("invalid header")
return n