UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

alex23 wuwei23 at gmail.com
Thu Jul 16 07:24:30 EDT 2009


On Jul 16, 9:00 pm, akhil1988 <akhilan... at gmail.com> wrote:
> I have switched to python 3.1 , but now I am getting some syntax errors in
> the code:

Python 3.x was a major release that endeavoured to clean up a number
of lingering issues with the language, the upshot being that it isn't
entirely backwards compatible with past versions. Unicode became the
default string type, which is what is causing the error here: the u-
prefix is no longer required (or even allowed).

However, Py3.x _does_ come with a handy tool for automatically
converting Python 2.x code to 3.x, called 2to3. One of the things it
should do is convert Py2.x unicode values into their correct
representation in 3.x.

With any luck, it should be able to convert the code you're using
entirely. Let us know how it goes.



More information about the Python-list mailing list