• Kirill Smelkov's avatar
    wcfs: zdata: Fix loading ZBlk data saved on py3 · bf816c40
    Kirill Smelkov authored
    Previously TestZBlk was xfailing as e.g.
    
            --- FAIL: TestZBlk/py3_pickle3 (0.00s)
        panic: ZBlk0(0000000000000002): loadBlkData: wendelin.bigfile.file_zodb.ZBlk0(0000000000000002): activate: pysetstate: expect str; got ogórek.Bytes [recovered]
                panic: ZBlk0(0000000000000002): loadBlkData: wendelin.bigfile.file_zodb.ZBlk0(0000000000000002): activate: pysetstate: expect str; got ogórek.Bytes
    
    because on py3 ZBlk data is saved as bytes while zblk.go code was trying
    to decode it as bytestring (str from py2).
    
    -> Fix that by adjusting ZBlk/go to follow py3 model with ZBlk data being
       considered to be bytes but also accepting bytestr from py2 for that.
    
    Now on go side loading ZBlk works for all py2_pickle{1,2,3} and
    py3_pickle3 data.
    bf816c40
zblk_test.go 5.25 KB