New submission from Nj Hsiong <nj.hsi...@gmail.com>:
python3's lib2to3 would fail in silence if python3 and its packages are installed as compiled .pyc files. Root cause is in Lib/lib2to3/refactor.py, the function get_all_fix_names only searches '.py' fix names. =========below is workaround========= --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -37,6 +37,12 @@ if remove_prefix: name = name[4:] fix_names.append(name[:-3]) + if name.startswith("fix_") and name.endswith(".pyc"): + if remove_prefix: + name = name[4:] + name = name[:-4] + if name not in fix_names: + fix_names.append(name) return fix_names ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 333393 nosy: njhsio priority: normal severity: normal status: open title: lib2to3 failed to convert as refactor's fixes not search.pyc files type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35708> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com