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

Support Python 3.12 #203

Closed
mtth opened this issue Aug 9, 2023 · 4 comments · Fixed by #204
Closed

Support Python 3.12 #203

mtth opened this issue Aug 9, 2023 · 4 comments · Fixed by #204

Comments

@mtth
Copy link
Owner

mtth commented Aug 9, 2023

Follow up to #192 (see #192 (comment)).

@musicinmybrain
Copy link
Contributor

I think I am going to work around this in the Fedora package by adding zombie-imp to install_requires so that, when from importlib import load_source raises an ImportError on Python 3.12, the from imp import load_source fallback works. The zombie-imp project is plastered with warnings not to use it, so this not a good long- or even medium-term solution. I’m not sure I will have time to dig into finding the correct way to replace load_source in this project, though.

@mtth
Copy link
Owner Author

mtth commented Aug 10, 2023

FYI just noticed Python 3.12's release notes have a section on replacing imp.load_source (found via python/cpython#104212 (comment)).

@musicinmybrain
Copy link
Contributor

Nice, that’s both new and useful. I’m happy to try it out and offer a PR. I don’t really have a high-level understanding of the autoload system to which this belongs; do we want the module cached in sys.modules or not?

@mtth
Copy link
Owner Author

mtth commented Aug 10, 2023

do we want the module cached in sys.modules or not?

Leaning towards caching since client classes are cached and executing the module multiple times might otherwise lead to race conditions.

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

Successfully merging a pull request may close this issue.

2 participants