Error of "if if else" expr sequence
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 4.3k
- フォーク
- 465
- 平均マージ
- 4日 11時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rocky/python-uncompyle6 のほかの issue
-
Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rocky/python-uncompyle6#506 · コメント 1 件 ·
-
Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rocky/python-uncompyle6#492 · コメント 4 件 ·
-
Redundant "else:"オープンControl Flow Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rocky/python-uncompyle6#486 ·
-
Missing "While True"オープンControl Flow Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rocky/python-uncompyle6#485 · コメント 4 件 ·
-
Duplicate Python 3.9+
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rocky/python-uncompyle6#484 · リアクション 9 件 ·
rocky/python-uncompyle6 の issue をすべて見る
似ている issue
-
🐛 Bug: Calendar work items cannot be opened on mobile対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
Status: Triage Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
Objects.List treats versions=false (and similar flags) as true対応中かも @andaaron が今日担当しました。 オープンpriority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/storage-testbench#829 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: memory provider treats 1:1 DMs as shared surfaces, so DM turns never receive reviewed recordsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
rlaope/oh-my-hermes#2088 ·
メンテナーはふだん 1 日以内に返信