mosquito / aiormq

Pure python AMQP 0.9.1 asynchronous client library
Other
276 stars 58 forks source link

hidden error in Connection._on_close #46

Closed alpo closed 5 years ago

alpo commented 5 years ago

I tried to subclass Connection to extend network failures processing.

class SomeClass(aiormq.Connection):
    async def _on_close(self, exc=ConnectionClosed(0, 'normal closed')):
        await super()._on_close(exc)
        # rest of the code

The "rest of the code" does not execute. After temporary removing of the line https://github.com/mosquito/aiormq/blob/master/aiormq/base.py#L142 I figured out that aiormq.Connection._on_close always fails in the line https://github.com/mosquito/aiormq/blob/master/aiormq/connection.py#L399 due to reason AttributeError: 'StreamWriter' object has no attribute 'wait_closed'.

Python 3.6.8 Linux aiormq 2.6.0

coroa commented 5 years ago

wait_closed has been introduced in Python 3.7 (see docs).

So, I suppose the minimum python requirement should be updated.

decaz commented 5 years ago

I see @mosquito fixed it at https://github.com/mosquito/aiormq/commit/41fa06dd87015c738dbd909bf6c2d2ff6ba9621f (2.7.5). @alpo can it be closed now?