Hi Lie,
On 12/05/2010 12:14 م, Lie Ryan wrote:
On 05/12/10 18:43, M. Bashir Al-Noimi wrote:
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/issue86...@ok_message=msg%20105576%20created%3cbr%3eissue%208693%20message_count%2c%20messages%20edited%20ok&@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.
Actually I tried to run chcp (some one mentioned it in bug report) but
it didn't fix the issue.
*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
Thanks a lot python currently works this is the right file.
--
Best Regards
Muhammad Bashir Al-Noimi
My Blog: http://mbnoimi.net
--
http://mail.python.org/mailman/listinfo/python-list