2to3 ParseError with UTF-8 BOM

Discussion in 'Python' started by Farshid, Nov 5, 2009.

  1. Farshid

    Farshid Guest

    I'm using Python 2.6.2 and when I run the 2to3 script on a file that
    contains a UTF-8 BOM I get the following error:

    RefactoringTool: Can't parse <filename>: ParseError: bad token:
    type=55, value='\xef', context=('', (1, 0))

    If I remove the BOM then it works fine. Is this expected behavior or a
    bug in the 2to3 script?

    -farshid
    Farshid, Nov 5, 2009
    #1
    1. Advertising

  2. Farshid <flashk <at> gmail.com> writes:
    > If I remove the BOM then it works fine. Is this expected behavior or a
    > bug in the 2to3 script?


    Try the 2to3 distributed in Python 3.1.
    Benjamin Peterson, Nov 6, 2009
    #2
    1. Advertising

  3. Farshid

    Farshid Guest

    On Nov 5, 7:18 pm, Benjamin Peterson <> wrote:

    > Try the 2to3 distributed in Python 3.1.


    I get the same error with the 2to3 script in Python 3.1

    -farshid
    Farshid, Nov 6, 2009
    #3
  4. En Fri, 06 Nov 2009 14:12:57 -0300, Farshid <> escribió:
    > On Nov 5, 7:18 pm, Benjamin Peterson <> wrote:
    >
    >> Try the 2to3 distributed in Python 3.1.

    >
    > I get the same error with the 2to3 script in Python 3.1


    Reported as http://bugs.python.org/issue7313

    --
    Gabriel Genellina
    Gabriel Genellina, Nov 13, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. X_AWieminer_X
    Replies:
    2
    Views:
    12,277
    JomoFrodo
    Aug 18, 2011
  2. Jean-Marc Autexier
    Replies:
    2
    Views:
    3,593
    Jean-Marc Autexier
    Aug 30, 2003
  3. Erik Wahlstrom
    Replies:
    1
    Views:
    621
    Richard Tobin
    Aug 18, 2004
  4. Replies:
    2
    Views:
    365
    Nathan Keel
    Aug 14, 2009
  5. Sebastian Feher

    parseError.reason Mozilla equivalent

    Sebastian Feher, Jul 25, 2006, in forum: Javascript
    Replies:
    1
    Views:
    122
Loading...

Share This Page