-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the 2to3 program and the lib2to3 module #104780
Comments
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
May 23, 2023
* Remove the Tools/scripts/2to3 script. * Remove the Lib/test/test_lib2to3/ directory. * Doc/tools/extensions/pyspecific.py: remove the "2to3fixer" object type. * Makefile and PC/layout/main.py no longer compile lib2to3 grammar files. * Update Makefile for 2to3 removal.
vstinner
added a commit
that referenced
this issue
May 23, 2023
* Remove the Tools/scripts/2to3 script. * Remove the Lib/test/test_lib2to3/ directory. * Doc/tools/extensions/pyspecific.py: remove the "2to3fixer" object type. * Makefile and PC/layout/main.py no longer compile lib2to3 grammar files. * Update Makefile for 2to3 removal.
Done by ae00b81 |
lib2to3 was deprecated in Python 3.11 by issue #84540. |
DenisDupeyron
added a commit
to AnacondaRecipes/python-feedstock
that referenced
this issue
Aug 30, 2024
DenisDupeyron
added a commit
to anaconda/py313t-recipes
that referenced
this issue
Aug 30, 2024
DenisDupeyron
added a commit
to anaconda/py313t-recipes
that referenced
this issue
Aug 30, 2024
2to3 was removed from Python 3.13 (python/cpython#104780)
cbouss
pushed a commit
to AnacondaRecipes/python-feedstock
that referenced
this issue
Sep 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The 2to3 program is implemented with the lib2to3 module which implements a parser of the Python language. Problem: this parser is unable to parse Python 3.10 grammar :-( This issue was already known in Python 3.9 when PEP 617 – New PEG parser for CPython was approved.
The 2to3 program and the lib2to3 were marked as "pending" deprecated since Python 3.9, and then officially deprecated in Python 3.11 (
import lib2to3
emits aDeprecationWarning
).One of a famous user of lib2to3 was the black project but they decided to fork lib2to3 and their fork was made compatible with Python 3.10 grammar (maybe also Python 3.11).
I propose to remove 2to3 and lib2to3 at the beginning of the Python 3.13 development cycle to give users more time to be prepared for this incompatible change before Python 3.13 final release (scheduled in October 2024).
cc @isidentical @lysnikolaou @pablogsal @ambv
Example of valid Python script (
script.py
:It works well on Python 3.11:
But lib2to3 is unable to parse it:
Linked PRs
The text was updated successfully, but these errors were encountered: