-
Notifications
You must be signed in to change notification settings - Fork 508
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
AttributeError: 'NoneType' object has no attribute 'split' on importing dns.query #1088
Comments
The immediate problem is that I can't reproduce this with a normal install on my Mac, so I decided to investigate. I went into the
If I remove the whole So, I advise taking a look at your metadata to see what might be missing. How old is the idna you have, if you can tell without the metadata? If you go into your site-packages directory and |
(And I should have said that dnspython is trying to look at the metadata of modules because it doesn't require you to install any modules, but will use features like idna or cryptography if they are present and new enough. It's the "is it new enough" check that is unexpectedly failing.) |
This stuff is ordinarily installed via ansible. Armed with your notes above, I decided to try to force a reinstall of idna. This showed me some complaints about wonkiness with info directories in the site_packages tree. I ended up manually removing the named offenders and doing another force-reinstall. (Not sure the final reinstall was actually necessary, but belt+suspenders+paranoia.) This seems to have cured the problem. I hypothesize that and automated upgrade somewhere along the way didn't complete cleanly. Looking at backups, I had a fragment of idna 3.6, and a more complete idna 3.7 in site-packages:
Thanks for your quick and informative response! |
Thanks for the clear ticket! I will leave this one open a bit to remind me to add some bulletproofing since I now know that |
importlib.metadata.version() can return None in some cases, even though it's not documented as doing so. Treat that as an error.
Closing this, as it should be fixed now. |
We don't have any specific next release date yet, but probably pretty soon as we've accumulated enough new stuff. |
import dns.query
results in a traceback due to an attribute error arising during module import.A script which uses dnspython crashes with this traceback:
pip show dnspython
produces:The non-comment lines of the script leading up to the import are:
python is 3.12.3, installed from pkgsrc. OS is smartos. The dnspython module was installed with pip. This script has been working for some years.
Presumably I managed to do something silly here, but...
The text was updated successfully, but these errors were encountered: