Closed bamthomas closed 3 years ago
On this branch, I am getting the following Error for the Condition
object:
Traceback (most recent call last):
File ".../async-test.py", line 28, in <module>
get_event_loop().run_until_complete(check_mailbox('IMAP_SERVER', 'IMAP_USER', 'IMAP_PASSWORD'))
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File ".../async-test.py", line 16, in check_mailbox
await imap_client.wait_hello_from_server()
File ".../aioimaplib/aioimaplib.py", line 686, in wait_hello_from_server
await asyncio.wait_for(self.protocol.wait('AUTH|NONAUTH'), self.timeout)
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
File ".../aioimaplib/aioimaplib.py", line 595, in wait
with (await self.state_condition):
TypeError: object Condition can't be used in 'await' expression
which python version ?
weird CI was green and it was green here but you're right the doc is saying that it should be
async with cond:
await cond.wait()
not sure that async with...
is same as with async...
I will have a look on thursday
I'm on version 3.9, so the newest. For new projects I usually try to stick with the newest versions so I don't get confused when a feature I try to use doesn't work.
Just wanted to let you know that in line 594, you still have with await self.state_condition:
instead of async with self.state_condition:
, causing a TypeError to be raised.
With that fixed, I get the following:
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<BaseEventLoop.create_connection() done, defined at /usr/lib/python3.9/asyncio/base_events.py:967> exception=gaierror(-2, 'Name or service not known')>
It should be related to python 3.9 I guess. I will try to test with 3.9 (didn't manage to install virtualenv with it)
as mentioned in #52 it is legit to go from
@coroutine
python 3.4 style to python 3.5 async/await (as python 3.5 is not even maintained)If it is ok for everyone I will merge this next week