Commit 09d79332 authored by Kirill Smelkov's avatar Kirill Smelkov

test/*: Add py2 + pickle protocol=3 ZODB kind to test matrix

This is the kind of databases that ZODB/py2 generates starting from ZODB
5.4, more specifically from https://github.com/zopefoundation/ZODB/commit/12ee41c4
done in 2018. In other words since 5-6 years ago this is the kind of
databases that are generated by default. Which means we should have test
coverage for this as well.

And adding this test coverage automatically reveals one bug in zodbdump:
its pretty=zpickledis mode used pickletools to dump content of pickles,
but since on py2 standard pickletools knows nothing about protocol=3
opcodes, that dump mode was failing on SHORT_BINBYTES ('C') opcode:

    kirr@deca:~/src/wendelin/z/zodbtools/zodbtools/test$ ./gen_testdata.py
    Traceback (most recent call last):
      File "./gen_testdata.py", line 392, in <module>
        main()
      File "./gen_testdata.py", line 388, in main
        run_with_all_zodb_pickle_kinds(_)
      File "./gen_testdata.py", line 190, in run_with_all_zodb_pickle_kinds
        _(3)
      File "./gen_testdata.py", line 187, in _
        f()
      File "./gen_testdata.py", line 376, in _
        zodbdump(stor, None, None, pretty=pretty, out=f)
      File "/home/kirr/src/wendelin/z/zodbtools/zodbtools/zodbdump.py", line 169, in zodbdump
        pickletools.dis(dataf, disf, memo) # state
      File "/usr/lib/python2.7/pickletools.py", line 1933, in dis
        for opcode, arg, pos in genops(pickle):
      File "/usr/lib/python2.7/pickletools.py", line 1847, in genops
        code))
    ValueError: at position 63, opcode 'C' unknown

The fix is to use pickletools from zodbpickle instead of builtin
pickletools, and the fix needs to go in this patch as well because
otherwise it is not possible to generate the golden test files.

Inspecting the diff in between py2_pickle2 and py2_pickle3 one can see
that *BYTES opcodes start to be used for OIDs but otherwise test
database stays logically the same:

    (zdev+py39.env) kirr@deca:~/src/wendelin/z/zodbtools/zodbtools/test/testdata/1_!zext$ xdiff py2_pickle2/zdump.zpickledis.ok py2_pickle3/zdump.zpickledis.ok
    diff --git a/py2_pickle2/zdump.zpickledis.ok b/py2_pickle3/zdump.zpickledis.ok
    index 8586d39..cd9d7f5 100644
    --- a/py2_pickle2/zdump.zpickledis.ok
    +++ b/py2_pickle3/zdump.zpickledis.ok
    @@ -2,13 +2,13 @@ txn 0285cbac70a3d733 "p"
     user "user0.12"
     description "step 0.12"
     extension ""
    -obj 0000000000000001 34 sha1:9fae782fe3e33273b520c954925704856ca90dc6
    -      0: \x80 PROTO      2
    +obj 0000000000000001 34 sha1:fc9e49cca756681a9f36c915c6b7b8ad79f17cbc
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f0.12'
          31: q    BINPUT     2
          33: .    STOP
    @@ -19,13 +19,13 @@ txn 0285cbac7eb85219 "p"
     user "user0.15"
     description "step 0.15"
     extension ""
    -obj 0000000000000006 34 sha1:5dbf26359289e5a25f9755f832ea91cc8ee76686
    -      0: \x80 PROTO      2
    +obj 0000000000000006 34 sha1:76a94af22a81cd970845aeb3536f428a96afcfc7
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e0.15'
          31: q    BINPUT     2
          33: .    STOP
    @@ -36,13 +36,13 @@ txn 0285cbac917e4b4c "p"
     user "user0.19"
     description "step 0.19"
     extension ""
    -obj 0000000000000005 34 sha1:9e0a8797eb8f60498563703b1961126fba35be9b
    -      0: \x80 PROTO      2
    +obj 0000000000000005 34 sha1:4bd994052ba9a6b1f328c252d8766f13c53ae209
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a0.19'
          31: q    BINPUT     2
          33: .    STOP
    @@ -53,13 +53,13 @@ txn 0285cbac9ae147e6 "p"
     user "user0.21"
     description "step 0.21"
     extension ""
    -obj 0000000000000002 34 sha1:009174c1f01142f24495fa13738749ff528fd82c
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:633b0e1e89447d452468367784717fb48b0b83b1
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd0.21'
          31: q    BINPUT     2
          33: .    STOP
    @@ -70,13 +70,13 @@ txn 0285cbacada74119 "p"
     user "root0.0\nYour\nMagesty "
     description "undo 0.0\nmore detailed description\n\nzzz ..."
     extension ""
    -obj 0000000000000007 34 sha1:688eb65eab5e4c5ee5242b027bb9bfa5e1087598
    -      0: \x80 PROTO      2
    +obj 0000000000000007 34 sha1:b4bf7b467c62a1b51099ba1cc5b5aecd444d598d
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c0.22'
          31: q    BINPUT     2
          33: .    STOP
    @@ -87,13 +87,13 @@ txn 0285cbacb258bf66 "p"
     user "root0.1\nYour\nMagesty "
     description "undo 0.1\nmore detailed description\n\nzzz ...\t"
     extension ""
    -obj 0000000000000003 34 sha1:484358413b2746e8a05b1e3173051abedd28e1fa
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:3e5f02a2aa5f0ea3747a6c0ffeec090654091583
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g0.11'
          31: q    BINPUT     2
          33: .    STOP
    @@ -104,13 +104,13 @@ txn 0285cbacbbbbbc00 "p"
     user ""
     description "predelete 4"
     extension ""
    -obj 0000000000000000 213 sha1:a6e70638fafd4619841032356ae93a4da7b539c5
    -      0: \x80 PROTO      2
    +obj 0000000000000000 199 sha1:d9c10b69422e9a8279e2f738d9c270b88ee49861
    +      0: \x80 PROTO      3
           2: c    GLOBAL     'persistent.mapping PersistentMapping'
          40: q    BINPUT     1
          42: .    STOP
       highest protocol among opcodes = 2
    -     43: \x80 PROTO      2
    +     43: \x80 PROTO      3
          45: }    EMPTY_DICT
          46: q    BINPUT     2
          48: U    SHORT_BINSTRING 'data'
    @@ -119,60 +119,53 @@ obj 0000000000000000 213 sha1:a6e70638fafd4619841032356ae93a4da7b539c5
          57: q    BINPUT     4
          59: (    MARK
          60: U        SHORT_BINSTRING 'a'
    -     63: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x05'
    -     73: q        BINPUT     5
    -     75: c        GLOBAL     '__main__ Object'
    -     92: q        BINPUT     6
    -     94: \x86     TUPLE2
    -     95: Q        BINPERSID
    -     96: U        SHORT_BINSTRING 'c'
    -     99: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x07'
    -    109: q        BINPUT     7
    -    111: h        BINGET     6
    -    113: \x86     TUPLE2
    -    114: Q        BINPERSID
    -    115: U        SHORT_BINSTRING 'b'
    -    118: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x08'
    -    128: q        BINPUT     8
    -    130: h        BINGET     6
    -    132: \x86     TUPLE2
    -    133: Q        BINPERSID
    -    134: U        SHORT_BINSTRING 'e'
    -    137: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x06'
    -    147: q        BINPUT     9
    -    149: h        BINGET     6
    -    151: \x86     TUPLE2
    -    152: Q        BINPERSID
    -    153: U        SHORT_BINSTRING 'd'
    -    156: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x02'
    -    166: q        BINPUT     10
    -    168: h        BINGET     6
    -    170: \x86     TUPLE2
    -    171: Q        BINPERSID
    -    172: U        SHORT_BINSTRING 'g'
    -    175: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x03'
    -    185: q        BINPUT     11
    -    187: h        BINGET     6
    -    189: \x86     TUPLE2
    -    190: Q        BINPERSID
    -    191: U        SHORT_BINSTRING 'f'
    -    194: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x01'
    -    204: q        BINPUT     12
    -    206: h        BINGET     6
    -    208: \x86     TUPLE2
    -    209: Q        BINPERSID
    -    210: u        SETITEMS   (MARK at 59)
    -    211: s    SETITEM
    -    212: .    STOP
    -  highest protocol among opcodes = 2
    -
    -obj 0000000000000008 32 sha1:936674657cf846998d27356363832827fa612092
    -      0: \x80 PROTO      2
    +     63: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x05'
    +     73: c        GLOBAL     '__main__ Object'
    +     90: q        BINPUT     5
    +     92: \x86     TUPLE2
    +     93: Q        BINPERSID
    +     94: U        SHORT_BINSTRING 'c'
    +     97: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x07'
    +    107: h        BINGET     5
    +    109: \x86     TUPLE2
    +    110: Q        BINPERSID
    +    111: U        SHORT_BINSTRING 'b'
    +    114: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x08'
    +    124: h        BINGET     5
    +    126: \x86     TUPLE2
    +    127: Q        BINPERSID
    +    128: U        SHORT_BINSTRING 'e'
    +    131: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x06'
    +    141: h        BINGET     5
    +    143: \x86     TUPLE2
    +    144: Q        BINPERSID
    +    145: U        SHORT_BINSTRING 'd'
    +    148: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x02'
    +    158: h        BINGET     5
    +    160: \x86     TUPLE2
    +    161: Q        BINPERSID
    +    162: U        SHORT_BINSTRING 'g'
    +    165: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x03'
    +    175: h        BINGET     5
    +    177: \x86     TUPLE2
    +    178: Q        BINPERSID
    +    179: U        SHORT_BINSTRING 'f'
    +    182: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x01'
    +    192: h        BINGET     5
    +    194: \x86     TUPLE2
    +    195: Q        BINPERSID
    +    196: u        SETITEMS   (MARK at 59)
    +    197: s    SETITEM
    +    198: .    STOP
    +  highest protocol among opcodes = 3
    +
    +obj 0000000000000008 32 sha1:dfe254b2f091cf0c9bc835713d53012d44e7e7ca
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'b0*'
          29: q    BINPUT     2
          31: .    STOP
    @@ -183,13 +176,13 @@ txn 0285cbad02222280 " "
     user "user1.0"
     description "step 1.0"
     extension ""
    -obj 0000000000000006 33 sha1:f18e991b87b63cf1f9486d74d70020ff8d573eec
    -      0: \x80 PROTO      2
    +obj 0000000000000006 33 sha1:8f86d80dab366ac9780cdf9fd11aa622364397db
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e1.0'
          30: q    BINPUT     2
          32: .    STOP
    @@ -200,13 +193,13 @@ txn 0285cbad06d3a0cc " "
     user "user1.1"
     description "step 1.1"
     extension ""
    -obj 0000000000000008 33 sha1:c37e1d2350c8fc4e18cdbc53b432dba50e5196ba
    -      0: \x80 PROTO      2
    +obj 0000000000000008 33 sha1:3a63a76c25b677ada2cc1281f0fcbca823c2fde8
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'b1.1'
          30: q    BINPUT     2
          32: .    STOP
    @@ -217,13 +210,13 @@ txn 0285cbad0b851f19 " "
     user "user1.2"
     description "step 1.2"
     extension ""
    -obj 0000000000000003 33 sha1:28e9880fc0f50a9fea5c4a9e861adc1fe44c9f5c
    -      0: \x80 PROTO      2
    +obj 0000000000000003 33 sha1:c13b686e24c0b49869156feaafa5299a0be0db54
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.2'
          30: q    BINPUT     2
          32: .    STOP
    @@ -234,13 +227,13 @@ txn 0285cbad10369d66 " "
     user "user1.3"
     description "step 1.3"
     extension ""
    -obj 0000000000000003 33 sha1:5fb466e36ea6f847b73ad7976def8ad60e00e766
    -      0: \x80 PROTO      2
    +obj 0000000000000003 33 sha1:edbfe9c47fdfd3eeb89578d2b975196b72e04a47
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.3'
          30: q    BINPUT     2
          32: .    STOP
    @@ -251,13 +244,13 @@ txn 0285cbad14e81bb3 " "
     user "user1.4"
     description "step 1.4"
     extension ""
    -obj 0000000000000007 33 sha1:90b0ffa657df9de708913a2cbbd454126fd9de15
    -      0: \x80 PROTO      2
    +obj 0000000000000007 33 sha1:0ce3b56cc68602d8fcf9633527fc02d68d3c7963
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c1.4'
          30: q    BINPUT     2
          32: .    STOP
    @@ -268,13 +261,13 @@ txn 0285cbad19999a00 " "
     user "user1.5"
     description "step 1.5"
     extension ""
    -obj 0000000000000001 33 sha1:70b0a88b7652b82b82539800484dc7788277f32a
    -      0: \x80 PROTO      2
    +obj 0000000000000001 33 sha1:9bb04c55d1990c274fcc9f6d71701456c999154d
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f1.5'
          30: q    BINPUT     2
          32: .    STOP
    @@ -285,13 +278,13 @@ txn 0285cbad1e4b184c " "
     user "user1.6"
     description "step 1.6"
     extension ""
    -obj 0000000000000002 33 sha1:e9018b0bc67c9de08becf1f1fe1a548ed263fb29
    -      0: \x80 PROTO      2
    +obj 0000000000000002 33 sha1:3856df32ef7c512e9fd2599772e431ce3a18b5f5
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd1.6'
          30: q    BINPUT     2
          32: .    STOP
    @@ -302,13 +295,13 @@ txn 0285cbad22fc9699 " "
     user "user1.7"
     description "step 1.7"
     extension ""
    -obj 0000000000000007 33 sha1:0cd3f4b725517a5371429e2ef2f56ea54fe405fb
    -      0: \x80 PROTO      2
    +obj 0000000000000007 33 sha1:3d9da3b8f59a10f15e7c6796023153089d58d969
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c1.7'
          30: q    BINPUT     2
          32: .    STOP
    @@ -319,13 +312,13 @@ txn 0285cbad27ae14e6 " "
     user "user1.8"
     description "step 1.8"
     extension ""
    -obj 0000000000000007 33 sha1:13e366fb1d15d36a62099e6b835638407718229f
    -      0: \x80 PROTO      2
    +obj 0000000000000007 33 sha1:42c7e6fe473e6d99867b134c44c2d97813629b29
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c1.8'
          30: q    BINPUT     2
          32: .    STOP
    @@ -336,13 +329,13 @@ txn 0285cbad2c5f9333 " "
     user "user1.9"
     description "step 1.9"
     extension ""
    -obj 0000000000000006 33 sha1:3ac37991a56061c7407cc093ee2a71eef4379131
    -      0: \x80 PROTO      2
    +obj 0000000000000006 33 sha1:88921e4828cbbf11dc61ca6fbaf6595a88fe5076
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e1.9'
          30: q    BINPUT     2
          32: .    STOP
    @@ -353,13 +346,13 @@ txn 0285cbad31111180 " "
     user "user1.10"
     description "step 1.10"
     extension ""
    -obj 0000000000000005 34 sha1:407cc5710a22f6c387df45aab613aa3673b221c6
    -      0: \x80 PROTO      2
    +obj 0000000000000005 34 sha1:70fe501d55fc4052b73f5e3473262a48555f375f
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a1.10'
          31: q    BINPUT     2
          33: .    STOP
    @@ -370,13 +363,13 @@ txn 0285cbad35c28fcc " "
     user "user1.11"
     description "step 1.11"
     extension ""
    -obj 0000000000000007 34 sha1:88ab1add11652101077535c03b04e83fe4ddb88b
    -      0: \x80 PROTO      2
    +obj 0000000000000007 34 sha1:f1550b205f2cec40b8716673663fb6e446568772
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c1.11'
          31: q    BINPUT     2
          33: .    STOP
    @@ -387,13 +380,13 @@ txn 0285cbad3a740e19 " "
     user "user1.12"
     description "step 1.12"
     extension ""
    -obj 0000000000000006 34 sha1:4808aef147f8ded08ffaae2ce04265506385e7f7
    -      0: \x80 PROTO      2
    +obj 0000000000000006 34 sha1:e4587785ac67a316d288d89a2ecf5f7548804416
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e1.12'
          31: q    BINPUT     2
          33: .    STOP
    @@ -404,13 +397,13 @@ txn 0285cbad3f258c66 " "
     user "user1.13"
     description "step 1.13"
     extension ""
    -obj 0000000000000003 34 sha1:a9f47880096587b359fa7ea6a0fd213e800a24a4
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:c40d417ad5140d3c0a76b8119e1bc3f77924851f
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.13'
          31: q    BINPUT     2
          33: .    STOP
    @@ -421,13 +414,13 @@ txn 0285cbad43d70ab3 " "
     user "user1.14"
     description "step 1.14"
     extension ""
    -obj 0000000000000003 34 sha1:e5b3820378e102a61be2b5998ded3182c106c7db
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:141ee9a480f2e04c1c2b9fab6cab263010ab32cd
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.14'
          31: q    BINPUT     2
          33: .    STOP
    @@ -438,13 +431,13 @@ txn 0285cbad48888900 " "
     user "user1.15"
     description "step 1.15"
     extension ""
    -obj 0000000000000002 34 sha1:f136bac1befa0fbd1ebd50218f8d9afe00b9b0a5
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:ffd9e2447b4d6230d8e4c6584967ebd45bdb69cd
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd1.15'
          31: q    BINPUT     2
          33: .    STOP
    @@ -455,13 +448,13 @@ txn 0285cbad4d3a074c " "
     user "user1.16"
     description "step 1.16"
     extension ""
    -obj 0000000000000003 34 sha1:778621ce5c5e97b65343b1ab0cc1a3ce5702fbc8
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:e320d84b1e6f9b5507665684c57938c97fb8707a
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.16'
          31: q    BINPUT     2
          33: .    STOP
    @@ -472,13 +465,13 @@ txn 0285cbad51eb8599 " "
     user "user1.17"
     description "step 1.17"
     extension ""
    -obj 0000000000000001 34 sha1:eb6d2d192f3d8fe47a1b2e8119d390ed580c3fb4
    -      0: \x80 PROTO      2
    +obj 0000000000000001 34 sha1:a64a2fa4d8de13124ad15958bb44e93bb50be691
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f1.17'
          31: q    BINPUT     2
          33: .    STOP
    @@ -489,13 +482,13 @@ txn 0285cbad569d03e6 " "
     user "user1.18"
     description "step 1.18"
     extension ""
    -obj 0000000000000005 34 sha1:921682b323eb62f109d052bc1dfd4ffe0dbf79db
    -      0: \x80 PROTO      2
    +obj 0000000000000005 34 sha1:1a13c223b1e3c4336157bd9ea48bcebbf2bfeb83
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a1.18'
          31: q    BINPUT     2
          33: .    STOP
    @@ -506,13 +499,13 @@ txn 0285cbad5b4e8233 " "
     user "user1.19"
     description "step 1.19"
     extension ""
    -obj 0000000000000003 34 sha1:b0b31eb0b48548119153628eb3c6711d959e9f9b
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:a0b9f323870e42230530e88c3d0df4d0ff53d169
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.19'
          31: q    BINPUT     2
          33: .    STOP
    @@ -523,13 +516,13 @@ txn 0285cbad60000080 " "
     user "user1.20"
     description "step 1.20"
     extension ""
    -obj 0000000000000003 34 sha1:6bfd3298d0bea74cfa3d1f01bb722e958e3f1520
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:9d877b2756905d307e10300aa81428ea05c630d2
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g1.20'
          31: q    BINPUT     2
          33: .    STOP
    @@ -540,13 +533,13 @@ txn 0285cbad64b17ecc " "
     user "user1.21"
     description "step 1.21"
     extension ""
    -obj 0000000000000006 34 sha1:0d4b4837500e84b190ea2f92b16ab8ec0c486db5
    -      0: \x80 PROTO      2
    +obj 0000000000000006 34 sha1:4087f3ba62712e5c29b0d861d65bcc9904f0828e
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e1.21'
          31: q    BINPUT     2
          33: .    STOP
    @@ -557,13 +550,13 @@ txn 0285cbad6962fd19 " "
     user "user1.22"
     description "step 1.22"
     extension ""
    -obj 0000000000000005 34 sha1:eacbd02d0d78eece9d784da7f3fd0b2738ca6ce0
    -      0: \x80 PROTO      2
    +obj 0000000000000005 34 sha1:7f234b2ebf6c51bbc2acf55bc481b8ca0912b088
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a1.22'
          31: q    BINPUT     2
          33: .    STOP
    @@ -574,13 +567,13 @@ txn 0285cbad6e147b66 " "
     user "user1.23"
     description "step 1.23"
     extension ""
    -obj 0000000000000005 34 sha1:1b443228d5a434ddd9616ecb5aa90672c0ce9ba2
    -      0: \x80 PROTO      2
    +obj 0000000000000005 34 sha1:b54c8d6f9415eef59c5e4598d4ea459c7def7ae5
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a1.23'
          31: q    BINPUT     2
          33: .    STOP
    @@ -591,13 +584,13 @@ txn 0285cbad72c5f9b3 " "
     user "user1.24"
     description "step 1.24"
     extension ""
    -obj 0000000000000001 34 sha1:b35a1826cc6cb71b9ddff043f0e8f88b4d90281f
    -      0: \x80 PROTO      2
    +obj 0000000000000001 34 sha1:fc513f6a915be326a3d1212b12b389f284a329b2
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f1.24'
          31: q    BINPUT     2
          33: .    STOP
    @@ -620,33 +613,32 @@ txn 0285cbad80da7499 " "
     user "user"
     description "cyclic reference"
     extension ""
    -obj 0000000000000006 41 sha1:863d327e4b795efff7dff75bb73c0d20ea3981aa
    -      0: \x80 PROTO      2
    +obj 0000000000000006 39 sha1:baf12eac4d077427f66ff902f64d44a2a141bfd6
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    -     24: U    SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x06'
    -     34: q    BINPUT     2
    -     36: h    BINGET     1
    -     38: \x86 TUPLE2
    -     39: Q    BINPERSID
    -     40: .    STOP
    -  highest protocol among opcodes = 2
    +     22: \x80 PROTO      3
    +     24: C    SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x06'
    +     34: h    BINGET     1
    +     36: \x86 TUPLE2
    +     37: Q    BINPERSID
    +     38: .    STOP
    +  highest protocol among opcodes = 3

     txn 0285cbad858bf2e6 " "
     user ""
     description "predelete 6"
     extension ""
    -obj 0000000000000000 213 sha1:7247042925f5c18f3695d860eeb2759b78109a55
    -      0: \x80 PROTO      2
    +obj 0000000000000000 199 sha1:eaa0f1b643468f33c6b87a875d67eb3b349be5dd
    +      0: \x80 PROTO      3
           2: c    GLOBAL     'persistent.mapping PersistentMapping'
          40: q    BINPUT     1
          42: .    STOP
       highest protocol among opcodes = 2
    -     43: \x80 PROTO      2
    +     43: \x80 PROTO      3
          45: }    EMPTY_DICT
          46: q    BINPUT     2
          48: U    SHORT_BINSTRING 'data'
    @@ -655,60 +647,53 @@ obj 0000000000000000 213 sha1:7247042925f5c18f3695d860eeb2759b78109a55
          57: q    BINPUT     4
          59: (    MARK
          60: U        SHORT_BINSTRING 'a'
    -     63: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x05'
    -     73: q        BINPUT     5
    -     75: c        GLOBAL     '__main__ Object'
    -     92: q        BINPUT     6
    -     94: \x86     TUPLE2
    -     95: Q        BINPERSID
    -     96: U        SHORT_BINSTRING 'c'
    -     99: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x07'
    -    109: q        BINPUT     7
    -    111: h        BINGET     6
    -    113: \x86     TUPLE2
    -    114: Q        BINPERSID
    -    115: U        SHORT_BINSTRING 'b'
    -    118: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x08'
    -    128: q        BINPUT     8
    -    130: h        BINGET     6
    -    132: \x86     TUPLE2
    -    133: Q        BINPERSID
    -    134: U        SHORT_BINSTRING 'e'
    -    137: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\t'
    -    147: q        BINPUT     9
    -    149: h        BINGET     6
    -    151: \x86     TUPLE2
    -    152: Q        BINPERSID
    -    153: U        SHORT_BINSTRING 'd'
    -    156: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x02'
    -    166: q        BINPUT     10
    -    168: h        BINGET     6
    -    170: \x86     TUPLE2
    -    171: Q        BINPERSID
    -    172: U        SHORT_BINSTRING 'g'
    -    175: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x03'
    -    185: q        BINPUT     11
    -    187: h        BINGET     6
    -    189: \x86     TUPLE2
    -    190: Q        BINPERSID
    -    191: U        SHORT_BINSTRING 'f'
    -    194: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x01'
    -    204: q        BINPUT     12
    -    206: h        BINGET     6
    -    208: \x86     TUPLE2
    -    209: Q        BINPERSID
    -    210: u        SETITEMS   (MARK at 59)
    -    211: s    SETITEM
    -    212: .    STOP
    -  highest protocol among opcodes = 2
    -
    -obj 0000000000000009 32 sha1:1a43b55bc4a19245cce9eb5aa5ad411006f06afe
    -      0: \x80 PROTO      2
    +     63: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x05'
    +     73: c        GLOBAL     '__main__ Object'
    +     90: q        BINPUT     5
    +     92: \x86     TUPLE2
    +     93: Q        BINPERSID
    +     94: U        SHORT_BINSTRING 'c'
    +     97: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x07'
    +    107: h        BINGET     5
    +    109: \x86     TUPLE2
    +    110: Q        BINPERSID
    +    111: U        SHORT_BINSTRING 'b'
    +    114: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x08'
    +    124: h        BINGET     5
    +    126: \x86     TUPLE2
    +    127: Q        BINPERSID
    +    128: U        SHORT_BINSTRING 'e'
    +    131: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\t'
    +    141: h        BINGET     5
    +    143: \x86     TUPLE2
    +    144: Q        BINPERSID
    +    145: U        SHORT_BINSTRING 'd'
    +    148: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x02'
    +    158: h        BINGET     5
    +    160: \x86     TUPLE2
    +    161: Q        BINPERSID
    +    162: U        SHORT_BINSTRING 'g'
    +    165: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x03'
    +    175: h        BINGET     5
    +    177: \x86     TUPLE2
    +    178: Q        BINPERSID
    +    179: U        SHORT_BINSTRING 'f'
    +    182: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x01'
    +    192: h        BINGET     5
    +    194: \x86     TUPLE2
    +    195: Q        BINPERSID
    +    196: u        SETITEMS   (MARK at 59)
    +    197: s    SETITEM
    +    198: .    STOP
    +  highest protocol among opcodes = 3
    +
    +obj 0000000000000009 32 sha1:c10d44876cbf78e49f7cc633d985206f51ecc278
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e1*'
          29: q    BINPUT     2
          31: .    STOP
    @@ -725,13 +710,13 @@ txn 0285cbadc740db19 " "
     user "user2.0"
     description "step 2.0"
     extension ""
    -obj 0000000000000001 33 sha1:7b5599bdbf192e2d33e2597b52c8a72a751ddd13
    -      0: \x80 PROTO      2
    +obj 0000000000000001 33 sha1:118c46c51bb0f08ce76d8f4f3b5d923b81abdd46
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f2.0'
          30: q    BINPUT     2
          32: .    STOP
    @@ -742,13 +727,13 @@ txn 0285cbadcbf25966 " "
     user "user2.1"
     description "step 2.1"
     extension ""
    -obj 0000000000000002 33 sha1:50b0cf792f2fdc3fbfc5f47f148784924350e31c
    -      0: \x80 PROTO      2
    +obj 0000000000000002 33 sha1:89ff5e4440585130863b518c044d35e0154daecc
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.1'
          30: q    BINPUT     2
          32: .    STOP
    @@ -759,13 +744,13 @@ txn 0285cbadd0a3d7b3 " "
     user "user2.2"
     description "step 2.2"
     extension ""
    -obj 0000000000000003 33 sha1:71f1255a9751e0f223f079552e182cf26b27c0a6
    -      0: \x80 PROTO      2
    +obj 0000000000000003 33 sha1:e0470e3dee47625819f9bfe8085c1bce2a7a4a42
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g2.2'
          30: q    BINPUT     2
          32: .    STOP
    @@ -776,13 +761,13 @@ txn 0285cbadd5555600 " "
     user "user2.3"
     description "step 2.3"
     extension ""
    -obj 0000000000000003 33 sha1:e6236b8f0a4a2201c0c2375a8f360905108eff2d
    -      0: \x80 PROTO      2
    +obj 0000000000000003 33 sha1:b1a3740b05c6cae5f6c851b715c76dd7348228a9
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g2.3'
          30: q    BINPUT     2
          32: .    STOP
    @@ -793,13 +778,13 @@ txn 0285cbadda06d44c " "
     user "user2.4"
     description "step 2.4"
     extension ""
    -obj 0000000000000009 33 sha1:55a37439e3dc66552d680833af332b8be83bfc2a
    -      0: \x80 PROTO      2
    +obj 0000000000000009 33 sha1:d0368e87213747ab68d8e4f7a87ff1ea959ea579
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.4'
          30: q    BINPUT     2
          32: .    STOP
    @@ -810,13 +795,13 @@ txn 0285cbaddeb85299 " "
     user "user2.5"
     description "step 2.5"
     extension ""
    -obj 0000000000000005 33 sha1:6beb5d1ca083744ff1e8a13c0bee70c2df54a05c
    -      0: \x80 PROTO      2
    +obj 0000000000000005 33 sha1:e5af7f0b8e157926739f657e729594908d188a3d
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'a2.5'
          30: q    BINPUT     2
          32: .    STOP
    @@ -827,13 +812,13 @@ txn 0285cbade369d0e6 " "
     user "user2.6"
     description "step 2.6"
     extension ""
    -obj 0000000000000008 33 sha1:2a3221e27ac8fbf15ab75b38a9a65e727d237355
    -      0: \x80 PROTO      2
    +obj 0000000000000008 33 sha1:dc70c3b1413c79d75bcfdcc50c3e803273f857ef
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'b2.6'
          30: q    BINPUT     2
          32: .    STOP
    @@ -844,13 +829,13 @@ txn 0285cbade81b4f33 " "
     user "user2.7"
     description "step 2.7"
     extension ""
    -obj 0000000000000003 33 sha1:408fddc8c7255c5e2ed94c239ac57c211ab94b6d
    -      0: \x80 PROTO      2
    +obj 0000000000000003 33 sha1:35892bc2c71edb022b029aa1e4bf8201ccab4b0c
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g2.7'
          30: q    BINPUT     2
          32: .    STOP
    @@ -861,13 +846,13 @@ txn 0285cbadeccccd80 " "
     user "user2.8"
     description "step 2.8"
     extension ""
    -obj 0000000000000002 33 sha1:72eda0cdae0addbec9472e28b5a9a91ecdf41bbf
    -      0: \x80 PROTO      2
    +obj 0000000000000002 33 sha1:b2da174266d0f0e0b58c214e6d79851f4a18b554
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.8'
          30: q    BINPUT     2
          32: .    STOP
    @@ -878,13 +863,13 @@ txn 0285cbadf17e4bcc " "
     user "user2.9"
     description "step 2.9"
     extension ""
    -obj 0000000000000009 33 sha1:f1d87ba386f57291ecc925020a05df06caedb278
    -      0: \x80 PROTO      2
    +obj 0000000000000009 33 sha1:92cf61eb5855d3b25fecbe7a458f1b21946f5ba3
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.9'
          30: q    BINPUT     2
          32: .    STOP
    @@ -895,13 +880,13 @@ txn 0285cbadf62fca19 " "
     user "user2.10"
     description "step 2.10"
     extension ""
    -obj 0000000000000007 34 sha1:6696fa0434fadb645687c74c8561f0f55fce1fd6
    -      0: \x80 PROTO      2
    +obj 0000000000000007 34 sha1:f737655162c594cf8296b38f7c435a5e8e06d6d7
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c2.10'
          31: q    BINPUT     2
          33: .    STOP
    @@ -912,13 +897,13 @@ txn 0285cbadfae14866 " "
     user "user2.11"
     description "step 2.11"
     extension ""
    -obj 0000000000000002 34 sha1:14e8b27b3bc8bf5b4d86ca162cc1c912a29a1c05
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:032d8305ea9de2ec785fc77c1743a37bb64553cd
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.11'
          31: q    BINPUT     2
          33: .    STOP
    @@ -929,13 +914,13 @@ txn 0285cbadff92c6b3 " "
     user "user2.12"
     description "step 2.12"
     extension ""
    -obj 0000000000000003 34 sha1:db269b90a0df33aa7d411c672f93fb7d86bbdb87
    -      0: \x80 PROTO      2
    +obj 0000000000000003 34 sha1:975fd7ef6350b6543495a800852969f1d7833c83
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'g2.12'
          31: q    BINPUT     2
          33: .    STOP
    @@ -946,13 +931,13 @@ txn 0285cbae04444500 " "
     user "user2.13"
     description "step 2.13"
     extension ""
    -obj 0000000000000002 34 sha1:4b28f9e97ff4f61f3dfba30b9f7aceb4913215ce
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:d09e49d753b8183ba5e0fa042a239f103d54c873
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.13'
          31: q    BINPUT     2
          33: .    STOP
    @@ -963,13 +948,13 @@ txn 0285cbae08f5c34c " "
     user "user2.14"
     description "step 2.14"
     extension ""
    -obj 0000000000000007 34 sha1:c3eabecf360015b4b7555abc3a0dc0cea77fe7ed
    -      0: \x80 PROTO      2
    +obj 0000000000000007 34 sha1:109581582c53bf400e56780c331410e5195d19e0
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'c2.14'
          31: q    BINPUT     2
          33: .    STOP
    @@ -980,13 +965,13 @@ txn 0285cbae0da74199 " "
     user "user2.15"
     description "step 2.15"
     extension ""
    -obj 0000000000000009 34 sha1:25ffaeb6090581d72bce075a765d3cf4198af90f
    -      0: \x80 PROTO      2
    +obj 0000000000000009 34 sha1:e67485cd99587ee9e98158db69ed668fb233093d
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.15'
          31: q    BINPUT     2
          33: .    STOP
    @@ -997,13 +982,13 @@ txn 0285cbae1258bfe6 " "
     user "user2.16"
     description "step 2.16"
     extension ""
    -obj 0000000000000001 34 sha1:e934438dede49d14ee2d1d2afa8fa18774547764
    -      0: \x80 PROTO      2
    +obj 0000000000000001 34 sha1:b9f373fb2097836edf1c9ffbf0ca55d1d2b2168f
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'f2.16'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1014,13 +999,13 @@ txn 0285cbae170a3e33 " "
     user "user2.17"
     description "step 2.17"
     extension ""
    -obj 0000000000000008 34 sha1:9961f82b3f01204f80efbb3b62a2b98d9d3202fa
    -      0: \x80 PROTO      2
    +obj 0000000000000008 34 sha1:698e7a066839a9436339747fe7a85f475095af67
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'b2.17'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1031,13 +1016,13 @@ txn 0285cbae1bbbbc80 " "
     user "user2.18"
     description "step 2.18"
     extension ""
    -obj 0000000000000002 34 sha1:5294513e1e00c7de532f4f90068b2147bf87f673
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:0d2f350bbfeb38c85466b05b336f9414b9e91f77
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.18'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1048,13 +1033,13 @@ txn 0285cbae206d3acc " "
     user "user2.19"
     description "step 2.19"
     extension ""
    -obj 0000000000000009 34 sha1:523ec17c6d74016e3464d52bb7c7b7baa4b82a20
    -      0: \x80 PROTO      2
    +obj 0000000000000009 34 sha1:471ca065c05720073421a0aeab549cb1e58cf99f
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.19'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1065,13 +1050,13 @@ txn 0285cbae251eb919 " "
     user "user2.20"
     description "step 2.20"
     extension ""
    -obj 0000000000000008 34 sha1:14b17f0e944432782cb270205b2e96948d112619
    -      0: \x80 PROTO      2
    +obj 0000000000000008 34 sha1:3b543565ce78028b7118f322a8d1faf2439d70e4
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'b2.20'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1082,13 +1067,13 @@ txn 0285cbae29d03766 " "
     user "user2.21"
     description "step 2.21"
     extension ""
    -obj 0000000000000009 34 sha1:27744ea516240e0d00be75f26af9698f842bdda5
    -      0: \x80 PROTO      2
    +obj 0000000000000009 34 sha1:79714405c7319c5800c2fe5f192a8a1e8a33d873
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.21'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1099,13 +1084,13 @@ txn 0285cbae2e81b5b3 " "
     user "user2.22"
     description "step 2.22"
     extension ""
    -obj 0000000000000009 34 sha1:a3f303ddd4f2fb9369f6fbbb38ae8030f7f8188d
    -      0: \x80 PROTO      2
    +obj 0000000000000009 34 sha1:fb3f01b3470c5dcf9b4ce613bdd3821f2b9a3576
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.22'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1116,13 +1101,13 @@ txn 0285cbae33333400 " "
     user "user2.23"
     description "step 2.23"
     extension ""
    -obj 0000000000000002 34 sha1:343bed4b31f4fe69a92ee51d28fd7b9cfd6ecb8b
    -      0: \x80 PROTO      2
    +obj 0000000000000002 34 sha1:2a646981c19fe36d62d89df7e1fd344eb648f9b8
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2.23'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1133,13 +1118,13 @@ txn 0285cbae37e4b24c " "
     user "user2.24"
     description "step 2.24"
     extension ""
    -obj 0000000000000009 34 sha1:8804c60dc27b2e2f6908e2a099a5c5d4b5abc843
    -      0: \x80 PROTO      2
    +obj 0000000000000009 34 sha1:8b769601aed2ebd9f3cc8fe1e63b2cd8975f9f2d
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'e2.24'
          31: q    BINPUT     2
          33: .    STOP
    @@ -1162,33 +1147,32 @@ txn 0285cbae45f92d33 " "
     user "user"
     description "cyclic reference"
     extension ""
    -obj 0000000000000002 41 sha1:1e2e3ac81badec749c2082a08d205c06c6bb5119
    -      0: \x80 PROTO      2
    +obj 0000000000000002 39 sha1:f44b22761c7e1df86ed61823eb1404e463378a32
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    -     24: U    SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x02'
    -     34: q    BINPUT     2
    -     36: h    BINGET     1
    -     38: \x86 TUPLE2
    -     39: Q    BINPERSID
    -     40: .    STOP
    -  highest protocol among opcodes = 2
    +     22: \x80 PROTO      3
    +     24: C    SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x02'
    +     34: h    BINGET     1
    +     36: \x86 TUPLE2
    +     37: Q    BINPERSID
    +     38: .    STOP
    +  highest protocol among opcodes = 3

     txn 0285cbae4aaaab80 " "
     user ""
     description "predelete 2"
     extension ""
    -obj 0000000000000000 213 sha1:ee7932656b49c1a3f6271c9b58786f85a29179a2
    -      0: \x80 PROTO      2
    +obj 0000000000000000 199 sha1:a51d894c29856c2e8b8194e714cd84a0a23d03b8
    +      0: \x80 PROTO      3
           2: c    GLOBAL     'persistent.mapping PersistentMapping'
          40: q    BINPUT     1
          42: .    STOP
       highest protocol among opcodes = 2
    -     43: \x80 PROTO      2
    +     43: \x80 PROTO      3
          45: }    EMPTY_DICT
          46: q    BINPUT     2
          48: U    SHORT_BINSTRING 'data'
    @@ -1197,60 +1181,53 @@ obj 0000000000000000 213 sha1:ee7932656b49c1a3f6271c9b58786f85a29179a2
          57: q    BINPUT     4
          59: (    MARK
          60: U        SHORT_BINSTRING 'a'
    -     63: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x05'
    -     73: q        BINPUT     5
    -     75: c        GLOBAL     '__main__ Object'
    -     92: q        BINPUT     6
    -     94: \x86     TUPLE2
    -     95: Q        BINPERSID
    -     96: U        SHORT_BINSTRING 'c'
    -     99: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x07'
    -    109: q        BINPUT     7
    -    111: h        BINGET     6
    -    113: \x86     TUPLE2
    -    114: Q        BINPERSID
    -    115: U        SHORT_BINSTRING 'b'
    -    118: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x08'
    -    128: q        BINPUT     8
    -    130: h        BINGET     6
    -    132: \x86     TUPLE2
    -    133: Q        BINPERSID
    -    134: U        SHORT_BINSTRING 'e'
    -    137: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\t'
    -    147: q        BINPUT     9
    -    149: h        BINGET     6
    -    151: \x86     TUPLE2
    -    152: Q        BINPERSID
    -    153: U        SHORT_BINSTRING 'd'
    -    156: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\n'
    -    166: q        BINPUT     10
    -    168: h        BINGET     6
    -    170: \x86     TUPLE2
    -    171: Q        BINPERSID
    -    172: U        SHORT_BINSTRING 'g'
    -    175: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x03'
    -    185: q        BINPUT     11
    -    187: h        BINGET     6
    -    189: \x86     TUPLE2
    -    190: Q        BINPERSID
    -    191: U        SHORT_BINSTRING 'f'
    -    194: U        SHORT_BINSTRING '\x00\x00\x00\x00\x00\x00\x00\x01'
    -    204: q        BINPUT     12
    -    206: h        BINGET     6
    -    208: \x86     TUPLE2
    -    209: Q        BINPERSID
    -    210: u        SETITEMS   (MARK at 59)
    -    211: s    SETITEM
    -    212: .    STOP
    -  highest protocol among opcodes = 2
    -
    -obj 000000000000000a 32 sha1:c9a667705323348a209f8f3b22c1977dbcd3f7e9
    -      0: \x80 PROTO      2
    +     63: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x05'
    +     73: c        GLOBAL     '__main__ Object'
    +     90: q        BINPUT     5
    +     92: \x86     TUPLE2
    +     93: Q        BINPERSID
    +     94: U        SHORT_BINSTRING 'c'
    +     97: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x07'
    +    107: h        BINGET     5
    +    109: \x86     TUPLE2
    +    110: Q        BINPERSID
    +    111: U        SHORT_BINSTRING 'b'
    +    114: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x08'
    +    124: h        BINGET     5
    +    126: \x86     TUPLE2
    +    127: Q        BINPERSID
    +    128: U        SHORT_BINSTRING 'e'
    +    131: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\t'
    +    141: h        BINGET     5
    +    143: \x86     TUPLE2
    +    144: Q        BINPERSID
    +    145: U        SHORT_BINSTRING 'd'
    +    148: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\n'
    +    158: h        BINGET     5
    +    160: \x86     TUPLE2
    +    161: Q        BINPERSID
    +    162: U        SHORT_BINSTRING 'g'
    +    165: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x03'
    +    175: h        BINGET     5
    +    177: \x86     TUPLE2
    +    178: Q        BINPERSID
    +    179: U        SHORT_BINSTRING 'f'
    +    182: C        SHORT_BINBYTES '\x00\x00\x00\x00\x00\x00\x00\x01'
    +    192: h        BINGET     5
    +    194: \x86     TUPLE2
    +    195: Q        BINPERSID
    +    196: u        SETITEMS   (MARK at 59)
    +    197: s    SETITEM
    +    198: .    STOP
    +  highest protocol among opcodes = 3
    +
    +obj 000000000000000a 32 sha1:25364c8085cd5e554eb4756133186e5cf386032b
    +      0: \x80 PROTO      3
           2: c    GLOBAL     '__main__ Object'
          19: q    BINPUT     1
          21: .    STOP
       highest protocol among opcodes = 2
    -     22: \x80 PROTO      2
    +     22: \x80 PROTO      3
          24: U    SHORT_BINSTRING 'd2*'
          29: q    BINPUT     2
          31: .    STOP
parent bf772ce0
......@@ -20,7 +20,7 @@ setup(
keywords = 'zodb utility tool',
packages = find_packages(),
install_requires = ['ZODB', 'zodburi', 'zope.interface', 'pygolang >= 0.0.0.dev6', 'six', 'dateparser'],
install_requires = ['ZODB', 'zodbpickle', 'zodburi', 'zope.interface', 'pygolang >= 0.0.0.dev6', 'six', 'dateparser'],
extras_require = {
'test': ['pytest', 'freezegun', 'pytz', 'mock;python_version<="2.7"', 'random2'],
......
......@@ -40,7 +40,7 @@ testdir = dirname(__file__)
# NOTE keep in sync with run_with_all_zodb_pickle_kinds
for name in ('1',)
for zext in (False, True)
for zkind in ('py2_pickle1', 'py2_pickle2')
for zkind in ('py2_pickle1', 'py2_pickle2', 'py2_pickle3')
],
ids = lambda _: '%s%s/%s' % (_[0], '' if _[1] else '_!zext', _[2]),
)
......
......@@ -27,6 +27,7 @@ produce. The following combinations are covered:
py2: ZODB 4 and ZODB5 < 5.3 (pickle protocol 1)
py2: ZODB 5.3 (pickle protocol 2)
py2: ZODB ≥ 5.4 (pickle protocol 3)
Each such combination is referred to by "zkind" which indicates major Python
and pickle protocol versions used, for example "py2_pickle3". See
......@@ -172,6 +173,7 @@ def ext4subj(subj):
#
# py2: ZODB with pickle protocol = 1 generated by ZODB4 and ZODB5 < 5.3
# py2: ZODB with pickle protocol = 2 generated by ZODB5 5.3
# py2: ZODB with pickle protocol = 3 generated by ZODB5 ≥ 5.4
#
# For convenience f can detect under which environment it is being executed via current_zkind.
#
......@@ -185,6 +187,7 @@ def run_with_all_zodb_pickle_kinds(f):
f()
_run_with_zodb4py2_compat(_, 1)
_run_with_zodb4py2_compat(_, 2)
_(3)
# current_zkind returns string indicating currently activated ZODB environment,
# for example "py2_pickle3".
......
......@@ -31,6 +31,8 @@ from io import BytesIO
from zodbtools.test.testutil import fs1_testdata_py23
from pytest import mark, raises, xfail
from six import PY3
# verify zodbdump output against golden
@mark.parametrize('pretty', ('raw', 'zpickledis'))
......@@ -41,6 +43,13 @@ def test_zodbdump(tmpdir, ztestdata, pretty):
with open('%s/zdump.%s.ok' % (ztestdata.prefix, pretty), 'rb') as f:
dumpok = f.read()
# normalize zpickledis.ok to current python:
# bytes comes as *BYTES '... on py2 and *BYTES b'... on py3
if pretty == 'zpickledis':
if PY3:
dumpok = dumpok.replace(b"BYTES '", b"BYTES b'")
dumpok = dumpok.replace(b'BYTES "', b'BYTES b"')
out = BytesIO()
zodbdump(stor, None, None, pretty=pretty, out=out)
......
Class Name,T.Count,T.Bytes,Pct,AvgSize,C.Count,C.Bytes,O.Count,O.Bytes
persistent.mapping.PersistentMapping,3,597,21.390183%,199.000000,1,199,2,398
__main__.Object,65,2194,78.609817%,33.753846,9,313,56,1881
This diff is collapsed.
Class Name,T.Count,T.Bytes,Pct,AvgSize,C.Count,C.Bytes,O.Count,O.Bytes
persistent.mapping.PersistentMapping,3,597,21.390183%,199.000000,1,199,2,398
__main__.Object,65,2194,78.609817%,33.753846,9,313,56,1881
......@@ -67,11 +67,16 @@ from zodbtools.util import ashex, fromhex, sha1, txnobjv, parse_tidrange, TidRan
storageFromURL, hashRegistry, asbinstream
from ZODB._compat import loads, _protocol, BytesIO
from zodbpickle.slowpickle import Pickler as pyPickler
import pickletools
from ZODB.interfaces import IStorageTransactionInformation
from zope.interface import implementer
import sys
if sys.version_info.major < 3:
from zodbpickle import pickletools_2 as zpickletools
else:
from zodbpickle import pickletools_3 as zpickletools
import logging as log
import re
from golang.gcompat import qq
......@@ -124,7 +129,7 @@ def zodbdump(stor, tidmin, tidmax, hashonly=False, pretty='raw', out=asbinstream
out.write(b"extension\n")
extf = BytesIO(rawext)
disf = StringIO()
pickletools.dis(extf, disf)
zpickletools.dis(extf, disf)
out.write(b(indent(disf.getvalue(), " ")))
extra = extf.read()
if len(extra) > 0:
......@@ -165,8 +170,8 @@ def zodbdump(stor, tidmin, tidmax, hashonly=False, pretty='raw', out=asbinstream
dataf = BytesIO(obj.data)
disf = StringIO()
memo = {} # memo is shared in between class and state
pickletools.dis(dataf, disf, memo) # class
pickletools.dis(dataf, disf, memo) # state
zpickletools.dis(dataf, disf, memo) # class
zpickletools.dis(dataf, disf, memo) # state
out.write(b(indent(disf.getvalue(), " ")))
extra = dataf.read()
if len(extra) > 0:
......@@ -265,7 +270,7 @@ def serializeext(ext):
p = XPickler(buf, _protocol)
p.dump(ext)
out = buf.getvalue()
#out = pickletools.optimize(out) # remove unneeded PUT opcodes
#out = zpickletools.optimize(out) # remove unneeded PUT opcodes
assert loads(out) == ext
return out
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment