GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104780: Remove 2to3 program and lib2to3 module by vstinner · Pull Request #104781 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented May 23, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • 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.
  • Issue: Remove the 2to3 program and the lib2to3 module #104780

📚 Documentation preview 📚: https://cpython-previews--104781.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arhadthedev reacted with thumbs up emoji gpshead reacted with hooray emoji erlend-aasland reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • 🎉 1 reaction
  • 🚀 1 reaction
@vstinner
pythongh-104780: Remove 2to3 program and lib2to3 module
e1ffa37
* 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
vstinner requested review from a team, brettcannon, encukou, ericsnowcurrently, lysnikolaou, ncoghlan, pablogsal, rhettinger and warsaw as code owners May 23, 2023 01:38
@bedevere-bot bedevere-bot added the awaiting core review label May 23, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 23, 2023
Remove the 2to3 program and the lib2to3 module #104780
Closed
@vstinner

vstinner commented May 23, 2023

Copy link
Copy Markdown
Member Author

This PR is quite big, it changes 129 files:

Details git diff:
 .gitignore                                         |    1 -
 Doc/glossary.rst                                   |    9 -
 Doc/library/2to3.rst                               |  489 --
 Doc/library/development.rst                        |    4 +-
 Doc/tools/.nitignore                               |    1 -
 Doc/tools/extensions/pyspecific.py                 |    1 -
 Doc/whatsnew/3.13.rst                              |    3 +
 Lib/lib2to3/Grammar.txt                            |  196 -
 Lib/lib2to3/PatternGrammar.txt                     |   28 -
 Lib/lib2to3/__init__.py                            |    8 -
 Lib/lib2to3/__main__.py                            |    4 -
 Lib/lib2to3/btm_matcher.py                         |  163 -
 Lib/lib2to3/btm_utils.py                           |  280 --
 Lib/lib2to3/fixer_base.py                          |  186 -
 Lib/lib2to3/fixer_util.py                          |  453 --
 Lib/lib2to3/fixes/__init__.py                      |    1 -
 Lib/lib2to3/fixes/fix_apply.py                     |   68 -
 Lib/lib2to3/fixes/fix_asserts.py                   |   34 -
 Lib/lib2to3/fixes/fix_basestring.py                |   14 -
 Lib/lib2to3/fixes/fix_buffer.py                    |   22 -
 Lib/lib2to3/fixes/fix_dict.py                      |  106 -
 Lib/lib2to3/fixes/fix_except.py                    |   93 -
 Lib/lib2to3/fixes/fix_exec.py                      |   39 -
 Lib/lib2to3/fixes/fix_execfile.py                  |   53 -
 Lib/lib2to3/fixes/fix_exitfunc.py                  |   72 -
 Lib/lib2to3/fixes/fix_filter.py                    |   94 -
 Lib/lib2to3/fixes/fix_funcattrs.py                 |   21 -
 Lib/lib2to3/fixes/fix_future.py                    |   22 -
 Lib/lib2to3/fixes/fix_getcwdu.py                   |   19 -
 Lib/lib2to3/fixes/fix_has_key.py                   |  109 -
 Lib/lib2to3/fixes/fix_idioms.py                    |  152 -
 Lib/lib2to3/fixes/fix_import.py                    |   99 -
 Lib/lib2to3/fixes/fix_imports.py                   |  145 -
 Lib/lib2to3/fixes/fix_imports2.py                  |   16 -
 Lib/lib2to3/fixes/fix_input.py                     |   26 -
 Lib/lib2to3/fixes/fix_intern.py                    |   39 -
 Lib/lib2to3/fixes/fix_isinstance.py                |   52 -
 Lib/lib2to3/fixes/fix_itertools.py                 |   43 -
 Lib/lib2to3/fixes/fix_itertools_imports.py         |   57 -
 Lib/lib2to3/fixes/fix_long.py                      |   19 -
 Lib/lib2to3/fixes/fix_map.py                       |  110 -
 Lib/lib2to3/fixes/fix_metaclass.py                 |  228 -
 Lib/lib2to3/fixes/fix_methodattrs.py               |   24 -
 Lib/lib2to3/fixes/fix_ne.py                        |   23 -
 Lib/lib2to3/fixes/fix_next.py                      |  103 -
 Lib/lib2to3/fixes/fix_nonzero.py                   |   21 -
 Lib/lib2to3/fixes/fix_numliterals.py               |   28 -
 Lib/lib2to3/fixes/fix_operator.py                  |   97 -
 Lib/lib2to3/fixes/fix_paren.py                     |   44 -
 Lib/lib2to3/fixes/fix_print.py                     |   87 -
 Lib/lib2to3/fixes/fix_raise.py                     |   90 -
 Lib/lib2to3/fixes/fix_raw_input.py                 |   17 -
 Lib/lib2to3/fixes/fix_reduce.py                    |   35 -
 Lib/lib2to3/fixes/fix_reload.py                    |   36 -
 Lib/lib2to3/fixes/fix_renames.py                   |   70 -
 Lib/lib2to3/fixes/fix_repr.py                      |   23 -
 Lib/lib2to3/fixes/fix_set_literal.py               |   53 -
 Lib/lib2to3/fixes/fix_standarderror.py             |   18 -
 Lib/lib2to3/fixes/fix_sys_exc.py                   |   30 -
 Lib/lib2to3/fixes/fix_throw.py                     |   56 -
 Lib/lib2to3/fixes/fix_tuple_params.py              |  175 -
 Lib/lib2to3/fixes/fix_types.py                     |   61 -
 Lib/lib2to3/fixes/fix_unicode.py                   |   42 -
 Lib/lib2to3/fixes/fix_urllib.py                    |  196 -
 Lib/lib2to3/fixes/fix_ws_comma.py                  |   39 -
 Lib/lib2to3/fixes/fix_xrange.py                    |   73 -
 Lib/lib2to3/fixes/fix_xreadlines.py                |   25 -
 Lib/lib2to3/fixes/fix_zip.py                       |   46 -
 Lib/lib2to3/main.py                                |  273 --
 Lib/lib2to3/patcomp.py                             |  204 -
 Lib/lib2to3/pgen2/__init__.py                      |    4 -
 Lib/lib2to3/pgen2/conv.py                          |  257 --
 Lib/lib2to3/pgen2/driver.py                        |  177 -
 Lib/lib2to3/pgen2/grammar.py                       |  189 -
 Lib/lib2to3/pgen2/literals.py                      |   60 -
 Lib/lib2to3/pgen2/parse.py                         |  204 -
 Lib/lib2to3/pgen2/pgen.py                          |  386 --
 Lib/lib2to3/pgen2/token.py                         |   86 -
 Lib/lib2to3/pgen2/tokenize.py                      |  564 ---
 Lib/lib2to3/pygram.py                              |   43 -
 Lib/lib2to3/pytree.py                              |  853 ----
 Lib/lib2to3/refactor.py                            |  732 ---
 Lib/test/test_lib2to3/__init__.py                  |   11 -
 Lib/test/test_lib2to3/__main__.py                  |    4 -
 Lib/test/test_lib2to3/data/README                  |    6 -
 Lib/test/test_lib2to3/data/bom.py                  |    2 -
 Lib/test/test_lib2to3/data/crlf.py                 |    3 -
 Lib/test/test_lib2to3/data/different_encoding.py   |    6 -
 Lib/test/test_lib2to3/data/false_encoding.py       |    2 -
 Lib/test/test_lib2to3/data/fixers/bad_order.py     |    5 -
 .../test_lib2to3/data/fixers/myfixes/__init__.py   |    0
 .../data/fixers/myfixes/fix_explicit.py            |    6 -
 .../test_lib2to3/data/fixers/myfixes/fix_first.py  |    6 -
 .../test_lib2to3/data/fixers/myfixes/fix_last.py   |    7 -
 .../test_lib2to3/data/fixers/myfixes/fix_parrot.py |   13 -
 .../data/fixers/myfixes/fix_preorder.py            |    6 -
 Lib/test/test_lib2to3/data/fixers/no_fixer_cls.py  |    1 -
 .../test_lib2to3/data/fixers/parrot_example.py     |    2 -
 Lib/test/test_lib2to3/data/infinite_recursion.py   | 2669 -----------
 Lib/test/test_lib2to3/data/py2_test_grammar.py     |  971 ----
 Lib/test/test_lib2to3/data/py3_test_grammar.py     |  956 ----
 Lib/test/test_lib2to3/pytree_idempotency.py        |   94 -
 Lib/test/test_lib2to3/support.py                   |   69 -
 Lib/test/test_lib2to3/test_all_fixers.py           |   41 -
 Lib/test/test_lib2to3/test_fixers.py               | 4649 --------------------
 Lib/test/test_lib2to3/test_main.py                 |  139 -
 Lib/test/test_lib2to3/test_parser.py               |  718 ---
 Lib/test/test_lib2to3/test_pytree.py               |  472 --
 Lib/test/test_lib2to3/test_refactor.py             |  337 --
 Lib/test/test_lib2to3/test_util.py                 |  591 ---
 Lib/test/test_tools/test_sundry.py                 |    5 -
 Mac/BuildScript/scripts/postflight.framework       |    4 +-
 Mac/Makefile.in                                    |    2 -
 Makefile.pre.in                                    |   25 +-
 Misc/NEWS.d/3.8.0a1.rst                            |    4 +-
 .../2023-05-23-03-36-47.gh-issue-104780.P4e3Yf.rst |    2 +
 PC/layout/main.py                                  |   23 -
 PC/layout/support/props.py                         |    2 -
 PC/layout/support/python.props                     |    2 -
 Python/stdlib_module_names.h                       |    1 -
 Tools/README                                       |    3 +-
 Tools/msi/bundle/packagegroups/postinstall.wxs     |    2 +-
 Tools/msi/lib/lib_files.wxs                        |    4 -
 Tools/msi/msi.props                                |    5 +-
 Tools/peg_generator/Makefile                       |    3 +-
 Tools/peg_generator/scripts/benchmark.py           |    1 -
 Tools/scripts/2to3                                 |    5 -
 Tools/scripts/README                               |    1 -
 Tools/wasm/wasm_assets.py                          |    2 -
 129 files changed, 17 insertions(+), 20988 deletions(-)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arhadthedev
arhadthedev reviewed May 23, 2023
View reviewed changes
Comment thread Lib/test/test_tools/test_sundry.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits May 23, 2023 04:32
@vstinner
Remove outdated test_sundry.py comment
813cbbb
@vstinner
Doc: fix references to removed doc
832b8ba
JelleZijlstra
JelleZijlstra approved these changes May 23, 2023
View reviewed changes

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one nit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tools/README Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 23, 2023
@rhettinger
rhettinger removed their request for review May 23, 2023 05:07
vstinner and others added 3 commits May 23, 2023 08:59
@vstinner
Use !lib2to3 syntax in the doc
ac89415
@vstinner
Remove reference to removed tabnanny.py script
9467dca
@arhadthedev
Merge branch 'main' into remove_2to3
1827844
zooba
zooba approved these changes May 23, 2023
View reviewed changes

@zooba zooba left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra
Merge branch 'main' into remove_2to3
b0badca
@vstinner
vstinner merged commit ae00b81 into python:main May 23, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 23, 2023
@vstinner
vstinner deleted the remove_2to3 branch May 23, 2023 17:40
@vstinner

vstinner commented May 23, 2023

Copy link
Copy Markdown
Member Author

Thanks for reviews. I wasn't sure about the VS project changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@arhadthedev arhadthedev arhadthedev left review comments
@erlend-aasland erlend-aasland erlend-aasland left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@zooba zooba zooba approved these changes
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
@brettcannon brettcannon Awaiting requested review from brettcannon brettcannon is a code owner
@encukou encukou Awaiting requested review from encukou
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@vstinner @JelleZijlstra @zooba @arhadthedev @erlend-aasland @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.