This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davidparks21
Recipients davidparks21
Date 2019-09-22.18:02:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569175364.49.0.370257231179.issue38254@roundup.psfhosted.org>
In-reply-to
Content
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'
```
History
Date User Action Args
2019-09-22 18:02:44davidparks21setrecipients: + davidparks21
2019-09-22 18:02:44davidparks21setmessageid: <1569175364.49.0.370257231179.issue38254@roundup.psfhosted.org>
2019-09-22 18:02:44davidparks21linkissue38254 messages
2019-09-22 18:02:43davidparks21create