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

Handle removal of ConfigParser.readfp() in Python 3.12 #4494

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

AdamWill
Copy link
Contributor

@AdamWill AdamWill commented Jul 4, 2023

Per https://docs.python.org/3.12/whatsnew/3.12.html#removed , configparser.ConfigParser.readfp() is removed in Python 3.12. Assuming we still want to keep Python 2 compatibility, since there are still a bunch of uses of six in the codebase, I've changed this to do it the same way as it's done in freeipa ipaserver/install/certs.py, using readfp on Python 2 and read_file on Python 3.

Per https://docs.python.org/3.12/whatsnew/3.12.html#removed ,
configparser.ConfigParser.readfp() is removed in Python 3.12.
Assuming we still want to keep Python 2 compatibility, since
there are still a bunch of uses of six in the codebase, I've
changed this to do it the same way as it's done in freeipa
ipaserver/install/certs.py, using readfp on Python 2 and
read_file on Python 3.

Signed-off-by: Adam Williamson <[email protected]>
Copy link
Contributor

@ckelleyRH ckelleyRH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @AdamWill 👍

@ckelleyRH
Copy link
Contributor

I will backport this to v11.4, which is the branch from which we built the current version of Dogtag in Rawhide. Thanks again @AdamWill.

@ckelleyRH ckelleyRH merged commit 02b6fde into dogtagpki:master Jul 5, 2023
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 this pull request may close these issues.

2 participants