Serhiy Storchaka added the comment:

readline() is used only when unpickle opcodes PERSID, INT, LONG, FLOAT, STRING, 
UNICODE, INST, GLOBAL, GET, PUT. These opcodes are not used with protocol 4 
(all opcodes except GLOBAL is used only with protocol 0, and GLOBAL is used 
with protocol <= 3). Frames are used only with protocol 4. So there is very 
small chance to meet this bug in real data. But it is not zero, artificial 
pickled data which mixes FRAME with protocol 0 opcodes can be constructed by 
third-party software for some reasons.

Artificial example:

>>> pickletools.dis(b"\x80\x04\x95\x05\x00\x00\x00\x00\x00\x00\x00I42\n.")
    0: \x80 PROTO      4
    2: \x95 FRAME      5
   11: I    INT        42
   15: .    STOP
highest protocol among opcodes = 4

components: +Library (Lib)
stage:  -> needs patch

Python tracker <>
Python-bugs-list mailing list

Reply via email to