2to3 Help?

marco.m.petersen at gmail.com marco.m.petersen at gmail.com
Thu Jan 15 07:17:25 CET 2009


On Jan 15, 2:09 pm, "James Mills" <prolo... at shortcircuit.net.au>
wrote:
> On Thu, Jan 15, 2009 at 4:01 PM,  <marco.m.peter... at gmail.com> wrote:
> > I have Python 3.0. I tried to use the 2to3 program included with the
> > interpreter to convert some scripts for Python 2.5 to Python 3.0 ones.
> > When I try to start it form the Python command line, it says it is a
> > syntax error.
>
> > This was the line of code:
>
> > $ 2to3 testscript.py
>
> > Any help would be appreciated.
>
> $ 2to3 testscript.py
> RefactoringTool: Skipping implicit fixer: buffer
> RefactoringTool: Skipping implicit fixer: idioms
> RefactoringTool: Skipping implicit fixer: set_literal
> RefactoringTool: Skipping implicit fixer: ws_comma
> RefactoringTool: Can't open testscript.py: [Errno 2] No such file or
> directory: 'testscript.py'
> RefactoringTool: No files need to be modified.
> RefactoringTool: There was 1 error:
> RefactoringTool: Can't open testscript.py: [Errno 2] No such file or
> directory: 'testscript.py'
>
> Seems to work perfectly fine here.
>
> It would greatly help if you showed us the error!
>
> cheers
> James

The error was:

>>> $ 2to3.py testscript.py
File "<stdin>", line 1
    $ 2to3.py testscript.py
    ^
Syntax Error: Invalid Syntax

>>>




More information about the Python-list mailing list