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

Delay deprecated zipimport.zipimporter.load_module removal time to 3.15 #125746

Closed
Wulian233 opened this issue Oct 20, 2024 · 5 comments
Closed
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Wulian233
Copy link
Contributor

Wulian233 commented Oct 20, 2024

Feature or enhancement

Proposal:

This method have been deprecated since Python 3.10
At https://github.com/python/cpython/blob/main/Lib/zipimport.py#L224-L225

msg = ("zipimport.zipimporter.load_module() is deprecated and slated for "
               "removal in Python 3.12; use exec_module() instead")

edit: Delay the removal time to 3.15
#125746 (comment)

Linked PRs

@Wulian233 Wulian233 added the type-feature A feature request or enhancement label Oct 20, 2024
@Damien-Chen
Copy link
Contributor

Could I take this one ?

@Wulian233
Copy link
Contributor Author

Could I take this one ?

I've finish the PR

@ZeroIntensity
Copy link
Member

I would like to hold off on this change for one more version. A quick GitHub search shows that 1.8k projects are still relying on load_module (and my regular expression isn't perfect, so I'm certain that we're missing some).

The new zipimport methods (I'm using "new" loosely here, I'm talking about the 3.10 methods) were only added to typeshed in late June, so I would assume that many were intentionally using load_module over exec_module, because their IDE was telling them that it doesn't exist (to confirm that, adjusting my GitHub search shows that only 250 projects are using exec_module). Similarly, load_module isn't marked as @deprecated on typeshed, so when we did add it, it's unlikely that people realized they needed to migrate.

@Wulian233 Wulian233 changed the title Remove deprecated zipimport.zipimporter.load_module Delay deprecated zipimport.zipimporter.load_module removal time to 3.15 Oct 20, 2024
@brettcannon
Copy link
Member

@warsaw after our discussions at the core dev sprints I assume you're okay shifting this to 3.15 so it's 5 releases past 3.10 when the warning first appeared?

@warsaw
Copy link
Member

warsaw commented Oct 21, 2024

@warsaw after our discussions at the core dev sprints I assume you're okay shifting this to 3.15 so it's 5 releases past 3.10 when the warning first appeared?

No objections from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants