GeezerVison is showing github.com — zipimport: Remove deprecated find_loader() and find_module() methods, use find_spec() instead · Issue #94379 · python/cpython
zipimport: Remove deprecated find_loader() and find_module() methods, use find_spec() instead #94379DescriptionIn Python 3.10, the find_loader() and find_module() methods of zipimport were deprecated by commit d2e94bb and commit 57c6cb5.
It's now time to remove them. The find_spec() method should be used instead.
See issue #86301 and PEP 451 for the rationale.
I wrote PR #94380 to remove these methods. Activityadded a commit that references this issue on Jul 5, 2022gh-94379: Remove zipimport find_loader() and find_module() methods (#… warsaw commented on Oct 7, 2022 warsaw commented on Oct 7, 2022 @vstinner Shouldn't this ticket be closed given that the PR you referenced was merged? vstinner commented on Oct 10, 2022
@vstinner Shouldn't this ticket be closed given that the PR you referenced was merged?
First my PR #94380 also tried to remove load_module() but I got issues, so 92bcb26 only removes find_loader() and find_module() methods.
This issue title is only "zipimport: Remove deprecated find_loader() and find_module() methods", so yep, I'm fine with closing it. warsaw commented on Oct 10, 2022 Thanks @vstinner. When @brettcannon and I talked about it, we noticed that load_module() only raised ImportWarning in 3.10, so in 3.12 it will raise DeprecationWarning and will be removed in 3.14. vstinner commented on Oct 10, 2022 Ah? I only looked at zipimport.py code:
# Load and return the module named by 'fullname'.
def load_module(self, fullname):
"""load_module(fullname) -> module.
Load the module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the imported
module, or raises ZipImportError if it could not be imported.
Deprecated since Python 3.10. Use exec_module() instead.
"""
msg = ("zipimport.zipimporter.load_module() is deprecated and slated for "
"removal in Python 3.12; use exec_module() instead")
_warnings.warn(msg, DeprecationWarning)
(...)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|