saghul / pycares

Python interface for c-ares
https://pypi.org/project/pycares/
MIT License
163 stars 74 forks source link

Fatal Python error: PyImport_GetModuleDict: no module dictionary #105

Closed KevinJ90825 closed 4 years ago

KevinJ90825 commented 4 years ago

I've been trying to get a script to run on a Windows server. It runs fine on my Mac, but keeps throwing an error at the end of the script. The output from the script is as expected and completes entirely, then this error is thrown:

Fatal Python error: PyImport_GetModuleDict: no module dictionary
Current thread 0x00001880 (most recent call first):
    File "C:\Python37\lib\site-packages\pycares\__init__.py", line 387 in (lambda)

Currently I'm running Python 3.6.5 and getting this error but I've tried it up to Python 3.7.5 and get the same error. This seems like a Windows specific issue with Pycares since the same script runs fine on my Mac machine. Since the script executes correctly, even on windows, this seems like it is an error thrown in the cleanup of the script.

Any ideas on a cause or a workaround?

saghul commented 4 years ago

Hi Kevin. Hum. Can you try turning the lambda into a static class method? I think that might work.

saghul commented 4 years ago

No follow-up, closing.