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 — Meta issue for cleaning up import system cruft · Issue #97850 · python/cpython

Meta issue for cleaning up import system cruft #97850

New issue
Copy link
New issue
Copy link
Open
Open
Meta issue for cleaning up import system cruft#97850
Copy link
Assignees
brettcannonwarsaw
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlib

Description

@warsaw
warsaw
opened on Oct 4, 2022
Issue body actions

This is a meta issue tracking all the things that need to be cleaned up in the import system. From removing long deprecated APIs to migrating internal access to __spec__, we'll have several task lists for each related set of clean ups.

@brettcannon @ericsnowcurrently for visibility.

Removing deprecated APIs

Over in What's New for Python 3.11 there's a long list of things that have been deprecated long enough that they can be removed in Python 3.12. Here's that task list for tracking purposes. Watch for linked PRs (maybe one big one or many small ones -- we'll see!).

@brettcannon @ericsnowcurrently for visibility.

  • importlib.find_loader()
  • importlib.util.module_for_loader()
  • importlib.util.set_loader_wrapper()
  • importlib.util.set_package_wrapper()
  • importlib.abc.Loader.module_repr() (3.12: gh-97850: Remove all known instances of module_repr() #97876)
  • importlib.abc.MetaPathFinder.find_module()
  • importlib.abc.MetaPathFinder.find_module()
  • importlib.abc.PathEntryFinder.find_loader()
  • importlib.abc.PathEntryFinder.find_module()
  • importlib.machinery.BuiltinImporter.find_module()
  • importlib.machinery.BuiltinLoader.module_repr() (3.12: gh-97850: Remove all known instances of module_repr() #97876)
  • importlib.machinery.FileFinder.find_loader()
  • importlib.machinery.FileFinder.find_module()
  • importlib.machinery.FrozenImporter.find_module()
  • importlib.machinery.FrozenLoader.module_repr() (3.12: gh-97850: Remove all known instances of module_repr() #97876)
  • importlib.machinery.PathFinder.find_module()
  • importlib.machinery.WindowsRegistryFinder.find_module()
  • Remove pkgutil.ImpImporter (3.12: already deprecated)
  • Remove pkgutil.ImpLoader
  • Remove the imp module (3.12: Remove more deprecated importlib APIs from Python 3.12 #98040)
  • importlib.abc.Finder

Update docs

  • Make sure examples and details from PEP 302 are covered in the importlib docs (/cc @Yhg1s )
  • Remove https://docs.python.org/3/reference/import.html#open-issues (PR)
  • It would be really nice to have a diagram.
  • (import_machinery.rst) how about a section devoted just to the attributes of modules and packages, perhaps expanding upon or supplanting the related entries in the data model reference page?
  • runpy, pkgutil, et al in the library manual should all get “See Also” links at the top pointing to the new import system section.
  • Add more explanation regarding the different ways in which __main__ is initialized?
  • Add more info on __main__ quirks/pitfalls (i.e. copy from PEP 395).

Missing deprecations

Here's a list of related APIs that have not yet been deprecated, but should be. We'll deprecate them in 3.12 and remove them in 3.14.

  • pkgutil.find_loader()
  • pkgutil.get_loader() (or it needs to be reimplemented to not use find_loader())

Other:

  • Do we need to define importlib.abc.PathEntryFinder.find_spec() #103999
  • PR: gh-97850: Deprecate find_loader and get_loader in pkgutil #98520
  • PR: GH-97850: Suppress cross-references to the removed module_repr method #104133
  • PR: GH-97850: Suppress cross-references to removed importlib.util functions #104134
  • PR: gh-97850: Note in py312 whatsnew that importlib.util.set_loader and importlib.util.module_for_loader have been removed #108719
  • PR: [3.12] gh-97850: Note in py312 whatsnew that importlib.util.set_loader and importlib.util.module_for_loader have been removed (GH-108719) #108723
  • PR: gh-97850: remove find_loader and get_loader from pkgutil #119656
  • PR: gh-97850: Suggest TraversableResources as the alternative for ResourceLoader. #128601
  • PR: gh-97850: Remove the mention of removal from ResourceReader docs #128602
  • PR: [3.13] gh-97850: Remove the mention of removal from ResourceReader docs (GH-128602) #128654
  • PR: [3.12] gh-97850: Remove the mention of removal from ResourceReader docs (GH-128602) #128655
  • PR: [3.13] gh-97850: Suggest TraversableResources as the alternative for ResourceLoader (GH-128601) #128895
  • PR: [3.12] gh-97850: Suggest TraversableResources as the alternative for ResourceLoader (GH-128601) #128896
  • PR: gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module #129855
  • PR: [3.13] gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855) #130013
  • PR: [3.12] gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855) #130017
  • PR: gh-131152, pkgutil: Remove unused imports #131149
  • PR: GH-97850: Remove all uses and definitions of load_module() from importlib #142205
  • PR: gh-97850: Add load_module() removal to 3.15 What's New #156418
  • PR: [3.15] gh-97850: Add load_module() removal to 3.15 What's New (GH-156418) #156935

Activity

Next
  1. warsaw
    changed the title [-]Task list for cleaning up import system cruft for Python 3.12[/-] [+]Meta issue for cleaning up import system cruft[/+] on Oct 4, 2022
  2. warsaw
    added
    topic-importlib
    on Oct 5, 2022
  3. warsaw
    self-assigned this
    on Oct 5, 2022
  4. sobolevn
    added a commit that references this issue on Oct 5, 2022

    pythongh-97850: Remove deprecated functions from `importlib.utils`

    cb4e97c
  5. sobolevn commented on Oct 5, 2022

    @sobolevn
    sobolevn
    on Oct 5, 2022
    Member
    More actions

    I've removed importlib.utils.set_loader, importlib.utils.set_package, and
    importlib.utils.module_for_loader from importlib.utils in #97898 🎉

  6. warsaw
    added a commit that references this issue on Oct 5, 2022

    gh-97850: Remove all known instances of module_repr() (#97876)

    5dc3599
  7. brettcannon
    self-assigned this
    on Oct 5, 2022
  8. brettcannon
    added a commit that references this issue on Oct 5, 2022

    Remove the open issues section from the import reference

    0591f9f
  9. sobolevn
    added a commit that references this issue on Oct 5, 2022

    pythongh-97850: Remove deprecated functions from `importlib.utils`

    b3a8ee6
  10. carljm
    added a commit that references this issue on Oct 6, 2022

    Merge branch 'main' into dictwatch

    4bb5d9d
  11. brettcannon
    added a commit that references this issue on Oct 6, 2022

    gh-97850: Remove the open issues section from the import reference (#…

    f8edc6f
  12. miss-islington
    added 4 commits that reference this issue on Oct 6, 2022

    pythongh-97850: Remove the open issues section from the import refere…

    2ce98a8

    pythongh-97850: Remove the open issues section from the import refere…

    1fc2f7e

    gh-97850: Remove the open issues section from the import reference (G…

    bc03bf4

    [3.11] gh-97850: Remove the open issues section from the import refer…

    ae2ab47
  13. 51 remaining items

  14. brettcannon
    added 2 commits that reference this issue on Feb 11, 2025

    [3.13] gh-97850: Update the deprecation warning of `importlib.abc.Loa…

    e5c522e

    [3.12] gh-97850: Update the deprecation warning of `importlib.abc.Loa…

    96a6ee0
  15. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Feb 24, 2025
  16. vstinner
    added a commit that references this issue on Mar 12, 2025

    pythongh-97850: pkgutil: Remove unused imports

    544d8f2
  17. picnixz
    marked Remove deprecated importlib.load_module #133882 as a duplicate of this issue on May 11, 2025
  18. picnixz
    unmarked Remove deprecated importlib.load_module #133882 as a duplicate of this issue on May 11, 2025
  19. brettcannon
    added a commit that references this issue on Dec 2, 2025

    pythonGH-97850: Remove all uses and definitions of `load_module()` fr…

    d39b42d
  20. brettcannon
    added a commit that references this issue on Dec 10, 2025

    GH-97850: Remove all uses and definitions of `load_module()` from imp…

    880a790
  21. gaborbernat
    added 2 commits that reference this issue on Jun 3, 2026

    pythongh-150882: Remove unused importlib._bootstrap._object_name

    ab23622

    pythongh-150886: Remove unused importlib._bootstrap._object_name

    9ca2291
  22. brettcannon
    added a commit that references this issue on Jun 4, 2026

    gh-150886: Remove unused importlib._bootstrap._object_name (#150884)

    f906522
  23. philthompson10
    added a commit that references this issue on Jun 17, 2026

    pythongh-150886: Remove unused importlib._bootstrap._object_name (pyt…

    f484684
  24. encukou
    added a commit that references this issue on Sep 4, 2026

    gh-97850: Add load_module() removal to 3.15 What's New (GH-156418)

    7d71b3e
  25. hugovk
    added a commit that references this issue on Sep 5, 2026

    [3.15] gh-97850: Add load_module() removal to 3.15 What's New (GH-156418

    9a170c6
  26. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-97850: Add load_module() removal to 3.15 What's New (pythonG…

    7e7c825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @brettcannon
    brettcannon
  • @warsaw
    warsaw

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlib

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.