GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #94379

New issue
Copy link
New issue
Copy link
Closed
Closed
zipimport: Remove deprecated find_loader() and find_module() methods, use find_spec() instead#94379
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Jun 28, 2022
Issue body actions

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. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 28, 2022
  2. vstinner
    added a commit that references this issue on Jul 5, 2022

    gh-94379: Remove zipimport find_loader() and find_module() methods (#…

    92bcb26
  3. warsaw commented on Oct 7, 2022

    @warsaw
    warsaw
    on Oct 7, 2022
    Member
    More actions

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

  4. warsaw commented on Oct 7, 2022

    @warsaw
    warsaw
    on Oct 7, 2022
    Member
    More actions

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

  5. vstinner commented on Oct 10, 2022

    @vstinner
    vstinner
    on Oct 10, 2022
    MemberAuthor
    More actions

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

  6. vstinner
    closed this as completedon Oct 10, 2022
  7. warsaw commented on Oct 10, 2022

    @warsaw
    warsaw
    on Oct 10, 2022
    Member
    More actions

    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.

  8. vstinner commented on Oct 10, 2022

    @vstinner
    vstinner
    on Oct 10, 2022
    MemberAuthor
    More actions

    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 errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.