[issue38876] pickle is raising KeyError insteat of pickle.UnpicklingError under certain conditions
PCManticore
report at bugs.python.org
Thu Nov 21 08:08:15 EST 2019
PCManticore <pcmanticore at gmail.com> added the comment:
It seems there are a couple of places in `_pickle.c` where we favour a `KeyError` instead of `UnpicklingError` such as https://github.com/python/cpython/blob/master/Modules/_pickle.c#L6178. From a quick debugging it seems it originates in `load_long_binget`.
Ideally those places should return `UnpicklingError` instead, not sure why a `KeyError` was preferred. Happy to submit a patch if that's a change that makes sense.
----------
nosy: +Claudiu.Popa
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38876>
_______________________________________
More information about the Python-bugs-list
mailing list