python / python/cpython

Builds Without HAVE_DYNAMIC_LOADING Set Still Expose Features and API Related to Dynamic Modules

Offen
#122,950 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

3.14 extension-modules interpreter-core topic-importlib type-bug
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Bug report

Bug description:

When CPython is built without HAVE_DYNAMIC_LOADING set, we currently leave out a small handful of code in Python/import.c and Python/importdl.c. However, there is a bunch more that should probably be excluded (via #ifdef HAVE_DYNAMIC_LOADING):

  • some functions and constants in Python/importdl.c and Include/internal/pycore_importdl.h
  • some functions, constants, and state in Python/import.c and Include/internal/pycore_import.h
  • some code in Lib/importlib/_bootstrap_external.py
  • maybe some code in Objects/moduleobject.c
  • builds for Modules/Setup.stdlib
  • checks in Tools/build/check_extension_modules.py
  • modules listed by Tools/build/generate_stdlib_module_names.py

(Also see gh-122907.)

Getting this all correct would probably take a fair amount of effort. Perhaps the big question is would it be worth addressing all these cases?

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Überprüfe die in Python/import.c, Python/importdl.c, Include/internal/pycore_importdl.h, Include/internal/pycore_import.h, Lib/importlib/_bootstrap_external.py und Objects/moduleobject.c genannten Pfade für das dynamische Laden sowie die aufgeführten Tools/build-Skripte und Modules/Setup.stdlib. Vergleiche das Verhalten, wenn HAVE_DYNAMIC_LOADING nicht gesetzt ist, unter Berücksichtigung von gh-122907, und ermittle den vollständigen Umfang, bevor du definierst, was ein konsistenter Ausschluss dynamischer Modul-APIs und -Funktionen bedeuten würde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.