Skip to content

Python >=3.12 Compatibility #11

@LiamOS

Description

@LiamOS

With python 3.12, SafeConfigParser has been removed; deprecated since 3.2.
Fixing this issue locally didn't resolve this for me, so I guess the incompatibility goes slightly deeper than one import.

As an aside, if it would be possible to release the next version of gegede on PyPi that would be much appreciated. 🙂

(env3.12)  liam@brick (~/dunendggd)% ./build_hall.sh miniproduction1_tms_nosand
Traceback (most recent call last):
  File "/home/liam/dunendggd/env3.12/lib/python3.12/site-packages/gegede/configuration.py", line 14, in parse
    try:                from ConfigParser import SafeConfigParser
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'ConfigParser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/liam/dunendggd/env3.12/bin/gegede-cli", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/liam/dunendggd/env3.12/lib/python3.12/site-packages/gegede/main.py", line 89, in main
    cfg = parse_config(args.config)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/liam/dunendggd/env3.12/lib/python3.12/site-packages/gegede/main.py", line 27, in parse_config
    cfg = gegede.configuration.configure(filenames)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/liam/dunendggd/env3.12/lib/python3.12/site-packages/gegede/configuration.py", line 106, in configure
    cfg = parse(filenames)
          ^^^^^^^^^^^^^^^^
  File "/home/liam/dunendggd/env3.12/lib/python3.12/site-packages/gegede/configuration.py", line 15, in parse
    except ImportError: from configparser import SafeConfigParser
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions