vmagamedov / grpclib

Pure-Python gRPC implementation for asyncio
http://grpclib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
936 stars 92 forks source link

Type Error when instantiating Client without ssl and with out ssl module installed #194

Closed jendrikjoe closed 3 months ago

jendrikjoe commented 3 months ago

I randomly stumbled over this one during testing today. If the ssl module cannot be imported and no ssl should be used the following line https://github.com/vmagamedov/grpclib/blob/5916cba69fc1f8a25fe8e749e3c4427897b3d228/grpclib/client.py#L666 raises AttributeError: 'NoneType' object has no attribute 'DefaultVerifyPaths'. A temporary solution was to just replace it with elif _ssl is not None and isinstance(ssl, _ssl.DefaultVerifyPaths):. I am not certain if it solves all the edge cases, but wanted to leave it here in case people stumble over the same issue 🤗

vmagamedov commented 3 months ago

Thanks for this finding

jendrikjoe commented 3 months ago

Thank you for swiftly fixing it 🤗