diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2015-07-02 17:41:03 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2015-07-02 17:41:03 (GMT) |
commit | 49c521fd5d3102916045551019368eae66dc7696 (patch) | |
tree | b51dc93916098c3c58bf9c89807341c2f499bdc0 /Lib/tarfile.py | |
parent | 44f323cb42418e6e2b83b7655146de66a7289dd4 (diff) | |
parent | b7a688b3a40705ab4f7f7035d40ec026899c7052 (diff) | |
download | cpython-49c521fd5d3102916045551019368eae66dc7696.zip cpython-49c521fd5d3102916045551019368eae66dc7696.tar.gz cpython-49c521fd5d3102916045551019368eae66dc7696.tar.bz2 |
Merge with 3.4: Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index bf2234f..d1279d2 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 |