wichert / lingua

Translation toolkit for Python
Other
45 stars 32 forks source link

Python 3.12 configparser module name error #109

Closed arkid15r closed 3 months ago

arkid15r commented 9 months ago

As Python 3.12 has been released there is some work that needs to be done in order to keep is compatible:

Traceback (most recent call last):
  File ".../venv/lib/python3.12/site-packages/lingua/extract.py", line 15, in <module>
    from configparser import SafeConfigParser
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (.../python3.12/configparser.py). Did you mean: 'RawConfigParser'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../python-holidays/scripts/l10n/generate_po_files.py", line 19, in <module>
    from lingua.extract import main as create_pot_file
  File ".../python-holidays/venv/lib/python3.12/site-packages/lingua/extract.py", line 17, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
sallner commented 8 months ago

Thanks for bringing this up. I also stumbled over this issue and would be interested in a fix.

Are you still working on this package @wichert ?

arkid15r commented 3 months ago

Closing in favor of https://github.com/vacanza/lingva/pull/1