This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: build_py support for lib2to3 is stale
Type: Stage:
Components: Distutils Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, loewis, mhammond, theller
Priority: normal Keywords: patch

Created on 2008-10-08 00:49 by mhammond, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
build_py.diff loewis, 2008-10-08 06:58
test2to3.tar.gz loewis, 2008-10-08 07:00
Messages (5)
msg74506 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2008-10-08 00:49
The way build_py uses lib2to3 is out of date.  Instead of a dummy
Options object a dict should be used, and it seems the 'fixers' must
explicitly be loaded.  I'm afraid I don't have a specific patch as I
don't have a good test case, but the lib2to3 code needs to look
something like:

from lib2to3.refactor import RefactoringTool, get_fixers_from_package
fixers = get_fixers_from_package('lib2to3.fixes')
options = dict(doctests_only=False, fix=[], list_fixes=[], 
               print_function=False, verbose=False,
               write=True)
r = RefactoringTool(fixers, options)
r.refactor(self.updated_files)
msg74516 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-10-08 06:58
Here is a patch. I also include a test case, which is intended to go
into the Demo directory.
msg74526 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2008-10-08 13:02
r=me - thanks.
msg74546 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-10-08 20:38
The options dictionary only supports the "print_function" as of now, and
that's default by false anyway.
msg74792 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-10-15 05:58
Committed as r66901
History
Date User Action Args
2022-04-11 14:56:40adminsetgithub: 48322
2008-10-15 05:58:40loewissetstatus: open -> closed
messages: + msg74792
2008-10-09 18:13:27thellersetnosy: + theller
2008-10-08 20:39:00benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg74546
2008-10-08 13:02:46mhammondsetkeywords: - needs review
resolution: accepted
messages: + msg74526
2008-10-08 07:00:06loewissetkeywords: + needs review
files: + test2to3.tar.gz
2008-10-08 06:58:34loewissetfiles: + build_py.diff
keywords: + patch
messages: + msg74516
2008-10-08 00:49:57mhammondcreate