Error of "if if else" expr sequence
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- compilers, reverse-engineering
Línea de trabajo
Reproduce the issue from test.py by compiling it with Python 3.8.5 or 3.6.9, then run uncompyle6 test.pyc > test_dec.py and compare the control-flow output with the original. The work is done when separate if statements with a following else decompile without changing their behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Error of "if if else" expr sequence
How to Reproduce
here is the source code test.py:
a = 1
b = 1
if a:
print("a")
if b:
print("b")
else:
print("else")
then compile it with:
python3 -m compileall -b test.py
and decompile it
uncompyle6 test.pyc >test_dec.py
the output is:
a = 1
b = 1
if a:
print('a')
elif b:
print('b')
else:
print('else')
the decompiled code is quite different from the origin code
if run the code, it will print:
$ python3 test.py
a
b
$ python3 test_dec.py
a
Expected behavior
expected decompiled code may look like this:
a = 1
b = 1
if a:
print("a")
if b:
print("b")
else:
print("else")
Environment
this bug can be repeated in such environments:
Ubuntu 20.04
Python 3.8.5 (default, May 27 2021, 13:30:53) [GCC 9.3.0] on linux
uncompyle6 3.7.4 from pip
or
Ubuntu 18.04
Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
uncompyle6 3.7.4 from pip
Additional Environment or Context
This bug does not exist in decompile3, but decompile3 cannot handler python3.6 bytecode.
- Lenguaje dominante
- Python
- Estrellas
- 4.3k
- Forks
- 465
- Merge medio
- 4 d 11 h
- PR fusionados (30 d)
- 3
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rocky/python-uncompyle6
-
Works on decompyle3
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rocky/python-uncompyle6#506 · 1 comentario ·
-
Python 3.8 Volunteer wanted Works on decompyle3
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rocky/python-uncompyle6#492 · 4 comentarios ·
-
Redundant "else:"AbiertoControl Flow Python 3.8 Volunteer wanted Works on decompyle3
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
rocky/python-uncompyle6#486 ·
-
Missing "While True"AbiertoControl Flow Python 3.8 Volunteer wanted Works on decompyle3
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
rocky/python-uncompyle6#485 · 4 comentarios ·
-
Duplicate Python 3.9+
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
rocky/python-uncompyle6#484 · 9 reacciones ·
Todos los issues de rocky/python-uncompyle6
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
huggingface/smolagents#2976 ·
Los mantenedores suelen responder en 1 día
-
pulp-cli 0.41 break username password auth in older configs (cert and key present but empty)Abiertobug Triage-Needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FuRongJun-1999/dsh-memory#170 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pgvector/pgvector-python#163 ·
-
[开源推荐] 打拼音就出篆书的输入法,附古文字创作小工具Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
521xueweihan/HelloGitHub#3940 ·