Skip to content
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

Issue on python-3.12 with configparser removed from python #341

Open
GuillaumeSeren opened this issue Dec 15, 2023 · 2 comments
Open

Issue on python-3.12 with configparser removed from python #341

GuillaumeSeren opened this issue Dec 15, 2023 · 2 comments
Labels

Comments

@GuillaumeSeren
Copy link
Collaborator

Hey,
Since we fixed #338, we can see that there is an issue on configparser with python-3.12:
the error look like this:

____________ ERROR collecting afew/tests/test_dkimvalidityfilter.py ____________
ImportError while importing test module '/home/runner/work/afew/afew/afew/tests/test_dkimvalidityfilter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
afew/tests/test_dkimvalidityfilter.py:10: in <module>
from afew.Database import Database
afew/Database.py:8: in <module>
import notmuch
env/lib/python3.12/site-packages/notmuch/__init__.py:54: in <module>
from .database import Database
env/lib/python3.12/site-packages/notmuch/database.py:24: in <module>
from .compat import SafeConfigParser
env/lib/python3.12/site-packages/notmuch/compat.py:50: in <module>
from configparser import SafeConfigParser
E   ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?

Searching a little arround this error get me those:

I am 100% if the issue is in afew or notmuch,
it look like a good contribution for the project if someone want to dig this out.

@kopinions
Copy link

Hey, Since we fixed #338, we can see that there is an issue on configparser with python-3.12: the error look like this:

____________ ERROR collecting afew/tests/test_dkimvalidityfilter.py ____________
ImportError while importing test module '/home/runner/work/afew/afew/afew/tests/test_dkimvalidityfilter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
afew/tests/test_dkimvalidityfilter.py:10: in <module>
from afew.Database import Database
afew/Database.py:8: in <module>
import notmuch
env/lib/python3.12/site-packages/notmuch/__init__.py:54: in <module>
from .database import Database
env/lib/python3.12/site-packages/notmuch/database.py:24: in <module>
from .compat import SafeConfigParser
env/lib/python3.12/site-packages/notmuch/compat.py:50: in <module>
from configparser import SafeConfigParser
E   ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?

Searching a little arround this error get me those:

I am 100% if the issue is in afew or notmuch, it look like a good contribution for the project if someone want to dig this out.

It seem u have use the wrong notmuch version. The SafeConfigParser have been fix by notmuch already. Try to install notmuch 0.38.2, and use python3 setup.py install to install afew works for me

@kofm
Copy link

kofm commented Apr 8, 2024

With notmuch 0.38.3+17~gcd89065 and afew installed using latest commit with python setup.py install --prefix=~/.local I get the same exact error :(

EDIT: After a little bit of digging I was able to fix it by editing both afew and notmuch-python-bindings. As @GuillaumeSeren correctly pointed out this is happening because of the recent changes to configparser. I don't know if you want me to try to prepare a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants