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

pkgutil.ImpImporter removed from python 3.12 #888

Open
Morette opened this issue Aug 1, 2024 · 1 comment
Open

pkgutil.ImpImporter removed from python 3.12 #888

Morette opened this issue Aug 1, 2024 · 1 comment

Comments

@Morette
Copy link

Morette commented Aug 1, 2024

Bug Report

Description

Due some high CVEs on python 3.11.9 image, I need to update to 3.12.4 that is clean. The issue is that python 3.12 removed modules has been removed.
importlib

Is this a regression?

Yes, the previous version in which this bug was not present was: 3.11.9

Minimal Reproduction

any project with python 3.11.2 and drf-yasg 1.21.7

Stack trace / Error message

  File "/opt/venv/lib/python3.12/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/opt/venv/lib/python3.12/site-packages/drf_yasg/__init__.py", line 2, in <module>
    from pkg_resources import DistributionNotFound, get_distribution
  File "/opt/venv/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2191, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
@cclauss
Copy link
Contributor

cclauss commented Oct 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants