[go: up one dir, main page]

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

Exception if using user configuration file with Python 3.12 and above #106

Open
cmomberg opened this issue Sep 27, 2024 · 0 comments · May be fixed by #101
Open

Exception if using user configuration file with Python 3.12 and above #106

cmomberg opened this issue Sep 27, 2024 · 0 comments · May be fixed by #101

Comments

@cmomberg
Copy link

If a user configuration file ~/.egrc is used, the following exception is thrown by Python 3.12 and above when running eg:

Traceback (most recent call last):
  File "/home/<username>/.local/bin/eg", line 7, in <module>
    core.run_eg()
  File "/home/<username>/.local/lib/python3.12/site-packages/eg/core.py", line 166, in run_eg
    resolved_config = config.get_resolved_config(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/lib/python3.12/site-packages/eg/config.py", line 234, in get_resolved_config
    egrc_config = get_egrc_config(egrc_path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/lib/python3.12/site-packages/eg/config.py", line 196, in get_egrc_config
    egrc_config = get_config_tuple_from_egrc(config_path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/lib/python3.12/site-packages/eg/config.py", line 320, in get_config_tuple_from_egrc
    config.readfp(egrc)
    ^^^^^^^^^^^^^
AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?

This caused by the method readfp being removed from module configparser.ConfigParser in Python 3.12 and above (see https://docs.python.org/3.12/whatsnew/3.12.html#configparser for further information).

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

Successfully merging a pull request may close this issue.

1 participant