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: 2to3 should run under python 2.5
Type: Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 2.7, Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: benjamin.peterson, collinwinter, dmalcolm, jyasskin
Priority: normal Keywords: patch

Created on 2010-04-28 23:52 by jyasskin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
2to3_support_2.5.patch jyasskin, 2010-04-28 23:52
Messages (7)
msg104475 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2010-04-28 23:52
Sorry for being all curmudgeonly, but we're using 2to3 in the benchmark suite at http://hg.python.org/benchmarks/, and, since many of the non-CPython implementations are still only 2.5-compatible, the version there needs to run under python 2.5. At the same time, we'd like to be able to use the benchmark version of 2to3 to convert benchmarks to python-3, so we can benchmark changes to CPython's py3k branch. To do that, it'd be nice to be able to import the official 2to3 repository to pick up bug fixes. Therefore, it would be nice for the official repository to run under 2.5.

Here's a patch accomplishing that. It passes its test suite under both 2.5 and 2.6, and can convert itself, and then the converted version can reconvert the original version and get the same result.

You can also review the patch at http://codereview.appspot.com/996043.
msg104665 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-04-30 21:08
Your patch will break test_parser on Windows.
msg104668 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2010-04-30 21:59
In what way will my patch break test_parser on Windows? I preserved the behavior of re-opening the file in text mode after determining the encoding. Do I need to add 'U' to open()'s mode string?
msg104669 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-04-30 22:26
2010/4/30 Jeffrey Yasskin <report@bugs.python.org>:
>
> Jeffrey Yasskin <jyasskin@gmail.com> added the comment:
>
> In what way will my patch break test_parser on Windows? I preserved the behavior of re-opening the file in text mode after determining the encoding. Do I need to add 'U' to open()'s mode string?

Sorry, my mind was in other Python versions. It looks fine.
msg104673 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2010-04-30 23:05
Thanks. Committed as r80668. May I update http://python.org/dev/peps/pep-0291/ to reflect that 2to3 should continue working on python-2.5?
msg104674 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-04-30 23:09
2010/4/30 Jeffrey Yasskin <report@bugs.python.org>:
>
> Jeffrey Yasskin <jyasskin@gmail.com> added the comment:
>
> Thanks. Committed as r80668. May I update http://python.org/dev/peps/pep-0291/ to reflect that 2to3 should continue working on python-2.5?

I suppose it can't hurt, but I don't know that anyone actually looks
at the either.
msg104678 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2010-04-30 23:31
Done.
History
Date User Action Args
2022-04-11 14:57:00adminsetgithub: 52812
2010-04-30 23:31:45jyasskinsetstatus: open -> closed
keywords: - needs review
messages: + msg104678

stage: patch review -> resolved
2010-04-30 23:09:57benjamin.petersonsetmessages: + msg104674
2010-04-30 23:05:00jyasskinsetkeywords: patch, patch, needs review

messages: + msg104673
2010-04-30 22:26:32benjamin.petersonsetmessages: + msg104669
2010-04-30 21:59:10jyasskinsetkeywords: patch, patch, needs review

messages: + msg104668
2010-04-30 21:08:13benjamin.petersonsetkeywords: patch, patch, needs review

messages: + msg104665
2010-04-29 00:04:30dmalcolmsetkeywords: patch, patch, needs review
nosy: + dmalcolm
2010-04-28 23:53:48collinwintersetkeywords: patch, patch, needs review
nosy: + collinwinter
2010-04-28 23:52:32jyasskincreate