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.

classification
Title: ClientConnectionError exception doesn't serialize property
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, davidparks21, ppperry, yselivanov
Priority: normal Keywords:

Created on 2019-09-20 00:00 by davidparks21, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg352818 - (view) Author: David Parks (davidparks21) Date: 2019-09-20 00:00
Original question posted here:

https://stackoverflow.com/questions/58019939/attributeerror-str-object-has-no-attribute-errno?noredirect=1#comment102443264_58019939

The following exception is encountered when placing an `aiohttp.client_exceptions.ClientConnectionError` on a `multiprocessing.Queue`. The problem appears to occur during deserialization.

```
Traceback (most recent call last):
  File "model_neural_simplified.py", line 318, in <module>
    main(**arg_parser())
  File "model_neural_simplified.py", line 314, in main
    globals()[command](**kwargs)
  File "model_neural_simplified.py", line 304, in predict
    next_neural_data, next_sample = reader.get_next_result()
  File "/project_neural_mouse/src/asyncs3/s3reader.py", line 174, in get_next_result
    result = future.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "model_neural_simplified.py", line 245, in read_sample
    f_bytes = s3f.read(read_size)
  File "/project_neural_mouse/src/asyncs3/s3reader.py", line 374, in read
    size, b = self._issue_request(S3Reader.READ, (self.url, size, self.position))
  File "/project_neural_mouse/src/asyncs3/s3reader.py", line 389, in _issue_request
    response = self.communication_channels[uuid].get()
  File "/usr/lib/python3.6/multiprocessing/queues.py", line 113, in get
    return _ForkingPickler.loads(res)
  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'
```

A similar issue is reproducible using the following code snippet:

```
import multiprocessing
import aiohttp


connection_key = aiohttp.client_reqrep.ConnectionKey
ose = OSError('test')

e = aiohttp.client_exceptions.ClientConnectorError(connection_key, ose)
q = multiprocessing.Queue()

q.put(e)
q.get(e)
```
msg352819 - (view) Author: David Parks (davidparks21) Date: 2019-09-20 00:14
Minor correction to the minimal reproducible test case:

```
import multiprocessing
import aiohttp


connection_key = aiohttp.client_reqrep.ConnectionKey
ose = OSError('test')

e = aiohttp.client_exceptions.ClientConnectorError(connection_key, ose)
q = multiprocessing.Queue()

q.put(e)
q.get()
```
msg352821 - (view) Author: (ppperry) Date: 2019-09-20 01:48
This seems more likely to be a bug in aiohttp than in python.
msg352823 - (view) Author: David Parks (davidparks21) Date: 2019-09-20 02:53
Oh yes, this belongs to aiohttp. I thought that was handled here. I'll move this to a git issue on that page, and I'm closing this.

https://github.com/aio-libs/aiohttp/issues/4077
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82410
2019-09-20 02:53:03davidparks21setstatus: open -> closed
title: ClientConnectionError exception doesn't serialize propertly -> ClientConnectionError exception doesn't serialize property
messages: + msg352823

resolution: rejected
stage: resolved
2019-09-20 01:48:08ppperrysettype: crash -> behavior

messages: + msg352821
nosy: + ppperry
2019-09-20 00:14:13davidparks21setmessages: + msg352819
2019-09-20 00:00:39davidparks21create