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: cp65001, PowerShell, Python crash.
Type: crash Stage:
Components: Windows Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Jean-Michel.Fauth, pitrou, vstinner
Priority: high Keywords:

Created on 2011-01-16 19:47 by Jean-Michel.Fauth, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg126370 - (view) Author: Jean-Michel Fauth (Jean-Michel.Fauth) Date: 2011-01-16 19:47
Just relying a discussion open on comp.lang.python,
http://groups.google.com/group/comp.lang.python/browse_thread/thread/771aa9081ad6584c#

1) Windows 7, open PowerShell
2) Change code page to cp65001
3) Launch Python3.1.2 or Python3.2.rc1 -> crash

Key points:
- The fact that Python does not recognize cp65001 is "ok".
- The Python crash is unexpected.
msg126378 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-16 22:11
Probably a legitimate "crash" (aka deliberate abort), since Python needs an encoding for its standard input/output text streams, and the encoding suggested by the system ("cp65001") isn't supported.
msg126379 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-01-16 22:16
> PS D:\jm> chcp 65001 
> Page de codes active : 65001 

Please don't do that: it is useless (it doesn't help to display or read more unicode characters) and it breaks Windows console: see issue #1602 (especially msg120414 and msg126303), and maybe also issue #6058.
msg126381 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-01-16 22:19
If the "crash" is the following message, this issue is a duplicate of  #6058.
---
PS D:\jm> c:\python31\python.exe 
Fatal Python error: Py_Initialize: can't initialize sys standard 
streams 
LookupError: unknown encoding: cp65001
---
It is not a crash: Python has no codec for the code page 65001, that's all. I closed #6058 because cp65001 cannot be set as an alias to utf-8. Anyway, use 65001 as console encoding is not a good idea. I close this issue: see #1602 for more information.
msg146469 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-26 23:49
I added a cp65001 codec to Python 3.3: see issue #13216. So Python will not "crash" anymore if the console code page is set to cp65001.
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55129
2011-10-26 23:49:03vstinnersetmessages: + msg146469
2011-01-18 21:40:47vstinnersetstatus: open -> closed
nosy: pitrou, vstinner, Jean-Michel.Fauth
2011-01-16 22:19:25vstinnersetresolution: duplicate
messages: + msg126381
nosy: pitrou, vstinner, Jean-Michel.Fauth
2011-01-16 22:16:16vstinnersetnosy: pitrou, vstinner, Jean-Michel.Fauth
messages: + msg126379
2011-01-16 22:11:18pitrousetnosy: + pitrou
messages: + msg126378
2011-01-16 22:09:25pitrousetpriority: normal -> high
nosy: + vstinner
2011-01-16 19:47:38Jean-Michel.Fauthcreate