summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2015-07-02 17:37:08 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2015-07-02 17:37:08 (GMT)
commitd048003d909360faf716c84459ed7067bdee5f08 (patch)
tree511aa9bdc019942ea67b16d2e557502587183eb4 /Lib/tarfile.py
parent97cceac3bd8fab9481deeaaafe82ce3de27e7e3f (diff)
downloadcpython-d048003d909360faf716c84459ed7067bdee5f08.zip
cpython-d048003d909360faf716c84459ed7067bdee5f08.tar.gz
cpython-d048003d909360faf716c84459ed7067bdee5f08.tar.bz2
Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 082f361..d7c1500 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -186,7 +186,7 @@ def nti(s):
# itn() below.
if s[0] != chr(0200):
try:
- n = int(nts(s) or "0", 8)
+ n = int(nts(s).strip() or "0", 8)
except ValueError:
raise InvalidHeaderError("invalid header")
else: