Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

zipimport: Remove deprecated find_loader() and find_module() methods, use find_spec() instead #94379

Closed

Description

@vstinner

In 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.

Activity

  1. added a commit that references this issue on Jul 5, 2022
  2. warsaw commented on Oct 7, 2022

    @warsaw
    Member

    I'm looking at removing find_loader() everywhere. @brettcannon @ericsnowcurrently

  3. warsaw commented on Oct 7, 2022

    @warsaw
    Member

    @vstinner Shouldn't this ticket be closed given that the PR you referenced was merged?

  4. vstinner commented on Oct 10, 2022

    @vstinner
    MemberAuthor

    @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.

  5. warsaw commented on Oct 10, 2022

    @warsaw
    Member

    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.

  6. vstinner commented on Oct 10, 2022

    @vstinner
    MemberAuthor

    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)
            (...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions