This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Py_Initialize: can't initialize sys standard streams
Type: crash Stage:
Components: Windows Versions: Python 3.1
process
Status: closed Resolution: duplicate
Dependencies: Superseder: cp720 encoding map
View: 1616979
Assigned To: Nosy List: loewis, mbnoimi
Priority: normal Keywords:

Created on 2010-05-12 03:25 by mbnoimi, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
error.log mbnoimi, 2010-05-12 03:25
cp720.py mbnoimi, 2010-05-12 04:57
Messages (10)
msg105566 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 03:25
After installing python-3.1.2.msi I'm not able to run to python.exe at all because it gives me the following error message:

Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp720

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

PS
    * I'm using WinXp SP3 32Bit
msg105567 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 03:27
I uninstalled python-2.6.3 before installing python-3.1.2.msi
msg105569 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-05-12 04:07
This is a duplicate of issue1616979.
msg105570 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 04:48
No No, this isn't duplicated issue because if I copied cp720.py to Python31\Lib\encodings

Python still crashed and gives me the following error

----
Fatal Python error: Py_Initialize: can't initialize sys standard streams
TypeError: 'NoneType' object is not callable

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
msg105571 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 04:57
This is the file I'm adding for removing warning message which is not the reason of crashing
msg105572 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 05:17
humm I re-read issue1616979

I'm confused is it really duplicate issue? if yes I couldn't find the way for fixing in issue1616979

PS
I'm newbie in Python and I faced this problem in first day I use Python so please forgive me if my discussion is stupid.
msg105573 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 06:06
For fixing this issue I tried to following:

1) Installed python-2.6.3.msi
2) Downloaded cp720.py, genwincodec.py from http://svn.python.org/view?rev=74000&view=rev
3) Copied cp720.py it to Python31\Lib\encodings
4) Run Python31\python.exe I got the following error:
---
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "C:\Python31\lib\encodings\__init__.py", line 98, in search_function
    level=0)
  File "C:\Python31\lib\encodings\cp720.py", line 50
    u'\x00'     #  0x00 -> CONTROL CHARACTER
          ^
SyntaxError: invalid syntax

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
---
5) copied genwincodec.py to Python26
6) Run C:\Python26>python.exe genwincodec.py 720  1>C:\Python31\Lib\encodings\cp720.py I got the following error message:
---
Traceback (most recent call last):
  File "genwincodec.py", line 8, in <module>
    from gencodec import codegen
ImportError: No module named gencodec
---

What's wrong? that's really exhausted! I didn't face this problem with any programming language before (I'm C++/Qt developer)
msg105575 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-05-12 06:29
Please trust me that this *is* a duplicate issue.

This bug tracker is not a place to get help; it is a place to report bugs. The bug you are reporting has been reported before. Other duplicate reports are #6995, #7496, #7600, #8120.

If you want help, contact python-list@python.org (aka news:comp.lang.python).
msg105576 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 06:49
Thanks and I'm very sorry for disturbance I'll try to get help through mailing list you've mentioned
msg105581 - (view) Author: Muhammad Bashir Al-Noimi (mbnoimi) Date: 2010-05-12 11:33
Lie Ryan gave me the solution,

copy http://svn.python.org/view/python/branches/py3k/Lib/encodings/cp720.py?view=markup to Python31\Lib\encodings
History
Date User Action Args
2022-04-11 14:57:00adminsetgithub: 52939
2010-05-12 11:33:30mbnoimisetmessages: + msg105581
2010-05-12 06:49:44mbnoimisetmessages: + msg105576
2010-05-12 06:29:25loewissetstatus: open -> closed

messages: + msg105575
2010-05-12 06:06:06mbnoimisetmessages: + msg105573
2010-05-12 05:17:45mbnoimisetmessages: + msg105572
2010-05-12 04:58:00mbnoimisetfiles: + cp720.py

messages: + msg105571
2010-05-12 04:48:18mbnoimisetstatus: closed -> open
2010-05-12 04:48:03mbnoimisetmessages: + msg105570
2010-05-12 04:07:40loewissetstatus: open -> closed

nosy: + loewis
messages: + msg105569

superseder: cp720 encoding map
resolution: duplicate
2010-05-12 03:27:50mbnoimisetmessages: + msg105567
2010-05-12 03:25:16mbnoimicreate