New submission from David Parks <davidpark...@gmail.com>:
Below is a minimum reproducible test case of what appears to be an issue in pickle. Before pickling the exception ClientConnectionError, from aiohttp, the property ClientConnectionError._os_error is a PermissionError object (a subclass of OSError). After deserialization ClientConnectionError._os_error appears to be a string based on the exception that is produced. I'm not familiar enough with pickle to make much headway here. ``` import aiohttp import pickle connection_key = aiohttp.client_reqrep.ConnectionKey ose = OSError(1, 'unittest') cce = aiohttp.client_exceptions.ClientConnectorError(connection_key, ose) cce_pickled = pickle.dumps(cce) pickle.loads(cce_pickled) ``` ``` Traceback (most recent call last): File "/opt/.pycharm_helpers/pydev/pydevd.py", line 1758, in <module> main() File "/opt/.pycharm_helpers/pydev/pydevd.py", line 1752, in main globals = debugger.run(setup['file'], None, None, is_module) File "/opt/.pycharm_helpers/pydev/pydevd.py", line 1147, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/opt/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/project_neural_mouse/src/ARCHIVE/scratch/scratch_13.py", line 11, in <module> File "/usr/local/lib/python3.6/dist-packages/aiohttp/client_exceptions.py", line 133, in __init__ super().__init__(os_error.errno, os_error.strerror) AttributeError: 'str' object has no attribute 'errno' ``` ---------- components: Library (Lib) messages: 352985 nosy: davidparks21 priority: normal severity: normal status: open title: Pickle not deserializing an OSError exception as expected type: crash versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38254> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com