gh-126992: Change pickle code to base 10 for load_long and load_int (GH-127042)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Justin Applegate 2024-12-11 05:37:59 -07:00 committed by GitHub
parent d5d84c3f13
commit ce76b547f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 64 additions and 9 deletions

View file

@ -1387,7 +1387,7 @@ class _Unpickler:
elif data == TRUE[1:]:
val = True
else:
val = int(data, 0)
val = int(data)
self.append(val)
dispatch[INT[0]] = load_int
@ -1407,7 +1407,7 @@ class _Unpickler:
val = self.readline()[:-1]
if val and val[-1] == b'L'[0]:
val = val[:-1]
self.append(int(val, 0))
self.append(int(val))
dispatch[LONG[0]] = load_long
def load_long1(self):