• Kirill Smelkov's avatar
    golang_str: bstr/ustr pickle support · ebd18f3f
    Kirill Smelkov authored
    Without explicitly overriding __reduce_ex__ pickling was failing for
    protocols < 2:
    
        _________________________ test_strings_pickle __________________________
    
            def test_strings_pickle():
                bs = b("мир")
                us = u("май")
    
                #from pickletools import dis
                for proto in range(0, pickle.HIGHEST_PROTOCOL):
        >           p_bs = pickle.dumps(bs, proto)
    
        golang/golang_str_test.py:282:
        _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
        self = b'\xd0\xbc\xd0\xb8\xd1\x80', proto = 0
    
            def _reduce_ex(self, proto):
        >       assert proto < 2
        E       RecursionError: maximum recursion depth exceeded in comparison
    
        /usr/lib/python3.9/copyreg.py:56: RecursionError
    
    See added comments for details.
    ebd18f3f
golang_str_test.py 26 KB