mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #25262. Added support for BINBYTES8 opcode in Python implementation of
unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8 opcodes no longer silently ignored on 32-bit platforms in C implementation.
This commit is contained in:
commit
525faaeffc
4 changed files with 44 additions and 2 deletions
|
@ -1205,6 +1205,14 @@ class _Unpickler:
|
|||
self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
|
||||
dispatch[BINUNICODE8[0]] = load_binunicode8
|
||||
|
||||
def load_binbytes8(self):
|
||||
len, = unpack('<Q', self.read(8))
|
||||
if len > maxsize:
|
||||
raise UnpicklingError("BINBYTES8 exceeds system's maximum size "
|
||||
"of %d bytes" % maxsize)
|
||||
self.append(self.read(len))
|
||||
dispatch[BINBYTES8[0]] = load_binbytes8
|
||||
|
||||
def load_short_binstring(self):
|
||||
len = self.read(1)[0]
|
||||
data = self.read(len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue