encoding issue (cp720)

M

M. Bashir Al-Noimi

Hi All,

I'm still a newbie in Python (I started learn it yesterday) and I faced
a huge problem cuz python always crashes because of encoding issue!
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp720

so I filed a bug report
<http://bugs.python.org/[email protected]_count, messages edited ok&@template=item>
about it but I couldn't find a solution for this problem so could you
please help me to run python correctly?

*Note:*

* I'm using: Windows XP SP3 32Bit, Python 3.1.2
* I tried to copy cp720.py
<http://svn.python.org/view/python/trunk/Lib/encodings/cp720.py>
to Python31\Lib\encodings but it didn't fix the issue and gives me
an error message (see attachment plz)
 
L

Lie Ryan

Hi All,

I'm still a newbie in Python (I started learn it yesterday) and I faced
a huge problem cuz python always crashes because of encoding issue!


so I filed a bug report
<http://bugs.python.org/[email protected]_count, messages edited ok&@template=item>
about it but I couldn't find a solution for this problem so could you
please help me to run python correctly?

This is partly a locale issue; your terminal (command prompt) is using a
locale yet unsupported by python. You can use 'chcp' to switch to
different terminal code page (e.g. use chcp 1250). You won't be able to
'print' arabic characters, but at least python should run.
*Note:*

* I'm using: Windows XP SP3 32Bit, Python 3.1.2
* I tried to copy cp720.py
<http://svn.python.org/view/python/trunk/Lib/encodings/cp720.py>
to Python31\Lib\encodings but it didn't fix the issue and gives me
an error message (see attachment plz)

You're using Python 3.1, the cp720.py file you copied is for Python 2.7
(trunk); there are some backward incompatible between python 2 and
python 3 (specifically in your case, unicode string is now default in
python 3, so unicode literal is no longer supported). Try using the
cp720.py from py3k branch:
http://svn.python.org/view/python/branches/py3k/Lib/encodings/cp720.py?view=markup
 
M

M. Bashir Al-Noimi

Hi Lie,

This is partly a locale issue; your terminal (command prompt) is using a
locale yet unsupported by python. You can use 'chcp' to switch to
different terminal code page (e.g. use chcp 1250). You won't be able to
'print' arabic characters, but at least python should run.
Actually I tried to run chcp (some one mentioned it in bug report) but
it didn't fix the issue.
You're using Python 3.1, the cp720.py file you copied is for Python 2.7
(trunk); there are some backward incompatible between python 2 and
python 3 (specifically in your case, unicode string is now default in
python 3, so unicode literal is no longer supported). Try using the
cp720.py from py3k branch:
http://svn.python.org/view/python/branches/py3k/Lib/encodings/cp720.py?view=markup
Thanks a lot python currently works this is the right file.
 

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,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top