• Kirill Smelkov's avatar
    go/zodb: Fix PyData.ClassName for py3_pickle3 · 6143b5b3
    Kirill Smelkov authored
    Test for PyData.ClassName currently fails for py3_pickle3 zkind:
    
        === RUN   TestPyClassName/py3_pickle3
            pydata_test.go:50: class name for "\x80\x03X\x18\x00\x00\x00ZODB.tests.testSerializeq\x00X\x13\x00\x00\x00ClassWithoutNewargsq\x01\x86q\x02N\x86q\x03.":
                have: "?.?"
                want: "ZODB.tests.testSerialize.ClassWithoutNewargs"
            pydata_test.go:50: class name for "\x80\x03X\x18\x00\x00\x00ZODB.tests.testSerializeq\x00X\x10\x00\x00\x00ClassWithNewargsq\x01\x86q\x02K\x01\x85q\x03\x86q\x04.":
                have: "?.?"
                want: "ZODB.tests.testSerialize.ClassWithNewargs"
    
    This happens because classname decoder was expecting class and module
    names to come as py2 bytestrings, while py3 emits them as unicode.
    
    -> Fix it by accepting both py2 bytestring and unicode for class and
    module names.
    6143b5b3
pydata.go 6.92 KB