mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
This commit is contained in:
parent
3ef80587f0
commit
b7a688b3a4
3 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue