Closed garyvdm closed 4 years ago
Hi,
I'm trying to reproduce the error with the following snippet:
import asyncio
import bonsai
async def main():
cli = bonsai.LDAPClient("ldap://unr.each.able")
conn = await cli.connect(is_async=True)
return conn
asyncio.run(main())
But it raises ConnectionError
as it's expected.
I tested with Python 3.6 on Ubuntu 18.04 and in python:3.7-alpine docker container, but the results were the same.
Can you send a code snippet and some more details about your environment? Maybe it's related to uvloop somehow.
I was able to reproduce it with this:
import asyncio
import bonsai
async def main():
cli = bonsai.LDAPClient("ldap://10.0.0.1")
conn = await cli.connect(is_async=True)
return conn
asyncio.run(main())
10.0.0.1
is not reachable on my network. You may need to change this to something that is not reachable on your network.
Makes sense, I changed it and now getting the same result as you. I'll look into it.
I added a condition check to avoid removing invalid file descriptor.
New release is out, containing this fix.
Steps to reproduce:
call:
await client.connect(is_async=True)
on a server that is not reachableActual:
As you can see, a
bonsai.errors.ConnectionError
but another error was raised in a handler of that exception.Expected:
A
bonsai.errors.ConnectionError
is raised.