2to3 on Mac - unknown encoding: mbcs

Discussion in 'Python' started by Skip Montanaro, Nov 6, 2009.

  1. I tried naively running 2to3 over the SpamBayes source code on my Mac
    and got this traceback:

    Traceback (most recent call last):
    File "/Users/skip/local/lib/python3.2/lib2to3/pgen2/tokenize.py", line 281, in find_cookie
    codec = lookup(encoding)
    LookupError: unknown encoding: mbcs

    SpamBayes does have several files which contain the "mbcs" coding
    cookie:

    ./windows/py2exe/gen_py/addin-designer.py
    ./windows/py2exe/gen_py/office-9.py
    ./windows/py2exe/gen_py/outlook-9.py

    After a little hunting I came across the docs for the codecs module,
    which for "mbcs" states:

    Windows only: Encode operand according to the ANSI codepage (CP_ACP)

    Is there something I can use to replace the mbcs coding cookies which
    will allow 2to3 to process these Windows-specific files?

    Thanks,

    --
    Skip Montanaro - - http://www.smontanaro.net/
     
    Skip Montanaro, Nov 6, 2009
    #1
    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. Edward K. Ream
    Replies:
    5
    Views:
    630
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Oct 23, 2003
  2. Tejas
    Replies:
    1
    Views:
    630
    William Ahern
    Nov 14, 2007
  3. Giovanni Bajo
    Replies:
    2
    Views:
    509
    Martin v. Löwis
    Jan 27, 2008
  4. Gabriel Genellina

    Re: 2to3 on Mac - unknown encoding: mbcs

    Gabriel Genellina, Nov 6, 2009, in forum: Python
    Replies:
    0
    Views:
    570
    Gabriel Genellina
    Nov 6, 2009
  5. Fabio Zadrozny
    Replies:
    1
    Views:
    404
    Martin v. Loewis
    May 7, 2010
Loading...

Share This Page