This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients alexandre.vassalotti, pitrou, serhiy.storchaka
Date 2018-04-03.01:08:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za>
In-reply-to
Content
test_clear_pickler_memo tested only the default protocol and fails when bump the default protocol to 4. For some reasons C implementation writes FRAME before PROTO when call Pickler.dump() repeatedly.

Python implementation:
b'\x80\x04\x95\x13\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x07abcdefg\x94h\x01K,e.'
    0: \x80 PROTO      4
    2: \x95 FRAME      19
   11: ]    EMPTY_LIST
   12: \x94 MEMOIZE    (as 0)
   13: (    MARK
   14: \x8c     SHORT_BINUNICODE 'abcdefg'
   23: \x94     MEMOIZE    (as 1)
   24: h        BINGET     1
   26: K        BININT1    44
   28: e        APPENDS    (MARK at 13)
   29: .    STOP
highest protocol among opcodes = 4

C implementation:
b'\x95\x15\x00\x00\x00\x00\x00\x00\x00\x80\x04]\x94(\x8c\x07abcdefg\x94h\x01K,e.'
    0: \x95 FRAME      21
    9: \x80 PROTO      4
   11: ]    EMPTY_LIST
   12: \x94 MEMOIZE    (as 0)
   13: (    MARK
   14: \x8c     SHORT_BINUNICODE 'abcdefg'
   23: \x94     MEMOIZE    (as 1)
   24: h        BINGET     1
   26: K        BININT1    44
   28: e        APPENDS    (MARK at 13)
   29: .    STOP
highest protocol among opcodes = 4
History
Date User Action Args
2018-04-03 01:08:24serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, alexandre.vassalotti
2018-04-03 01:08:23serhiy.storchakasetmessageid: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za>
2018-04-03 01:08:23serhiy.storchakalinkissue33209 messages
2018-04-03 01:08:22serhiy.storchakacreate