python / python/mypy

AssertionError in make_module_translation_map

Offen
#17,072 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

crash topic-mypyc
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Crash Report

mypyc asserted on specific directory.

Traceback

mypyc subtasks --show-traceback
Traceback (most recent call last):
  File "/tmp/ttrt/build/setup.py", line 5, in <module>
    ext_modules=mypycify(['subtasks', '--show-traceback'], opt_level="3", debug_level="1"),
  File "mypyc/build.py", line 525, in mypycify
  File "mypyc/build.py", line 435, in mypyc_build
  File "mypyc/build.py", line 243, in generate_c
  File "mypyc/codegen/emitmodule.py", line 425, in compile_modules_to_c
  File "mypyc/codegen/emitmodule.py", line 292, in compile_ir_to_c
  File "mypyc/namegen.py", line 50, in __init__
  File "mypyc/namegen.py", line 106, in make_module_translation_map
AssertionError: ['subtasks', 'subtasks.subtasks']

To Reproduce

cd /tmp/
mkdir ttrt
mkdir subtasks
touch subtasks/subtasks.py
mypyc subtasks  # this works

touch subtasks/__init__.py
mypyc subtasks --show-traceback  # this fails

Your Environment

mypyc -V
mypy 1.9.0 (compiled: yes)

python -V
Python 3.9.18
python is in venv

Linux Mint 21.1 Vera

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

Reproduce the failure with the directory layout and commands in the issue, then inspect mypyc/namegen.py around make_module_translation_map and the callers in mypyc/codegen/emitmodule.py. Confirm the fix by rerunning mypyc subtasks --show-traceback with subtasks/init.py present and checking that the assertion no longer occurs.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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