2to3 on Mac - unknown encoding: mbcs

S

Skip Montanaro

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,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top