-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update discovery.py #1304
Update discovery.py #1304
Conversation
Allow the initialization of the DNS_LOOKUP_ERROR variable to work without error. In my use case importing: ```from exchangelib import Folder``` raised the exception : ``` File "/root/.pex/unzipped_pexes/0bf8be61a4ebad23d549d3f586c2e0a8702a896d/fast_api/routers/connecteurMail/__init__.py", line 10, in <module> from exchangelib import Folder File "/root/.pex/installed_wheels/9c88853ab554b6cb969a214da5615182d3ce47dc7bd99beb3dc0e805ab8af438/exchangelib-5.2.1-py3-none-any.whl/exchangelib/__init__.py", line 1, in <module> from .account import Account, Identity File "/root/.pex/installed_wheels/9c88853ab554b6cb969a214da5615182d3ce47dc7bd99beb3dc0e805ab8af438/exchangelib-5.2.1-py3-none-any.whl/exchangelib/account.py", line 6, in <module> from .autodiscover import Autodiscovery File "/root/.pex/installed_wheels/9c88853ab554b6cb969a214da5615182d3ce47dc7bd99beb3dc0e805ab8af438/exchangelib-5.2.1-py3-none-any.whl/exchangelib/autodiscover/__init__.py", line 2, in <module> from .discovery import Autodiscovery, discover File "/root/.pex/installed_wheels/9c88853ab554b6cb969a214da5615182d3ce47dc7bd99beb3dc0e805ab8af438/exchangelib-5.2.1-py3-none-any.whl/exchangelib/autodiscover/discovery.py", line 20, in <module> dns.resolver.LifetimeTimeout, ^^^^^^^^^^^^ AttributeError: module 'dns' has no attribute 'resolver' ```
This doesn't make sense. If
|
Hello, thanks for your reply and sorry for rushing in the subject without any cheering words. This library is great, it has worked like a charm in production for over a year now. You are correct when saying taht something else is going on. The scenario is uvicorn starting a fastapi app which includes routers defined in modules. The In my realworld case, it seems that importing Folder in the main module solved the issue. I'll try to look further for the root cause if I can. Thanks anyway for your time and gret work. |
Maybe you have a module somewhere in your own code called |
I think I found something. While searching for other mentions to the Then adding Here is a minimalist reproducible example:
You should end up with :
Both solutions : changing the import syntax in discovery.py or importing exchangelib in the first level module seems to work. I don't understand yet why things aren't working properly. pymongo's requirements says : |
Sounds like Still, I don't think this is an issue with exchangelib, or an issue exchangelib should alleviate. |
I assume |
Allow the initialization of the DNS_LOOKUP_ERROR variable to work without error.
In my use case importing:
from exchangelib import Folder
raised the exception :