Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp65001, PowerShell, Python crash. #55129

Closed
Jean-MichelFauth mannequin opened this issue Jan 16, 2011 · 5 comments
Closed

cp65001, PowerShell, Python crash. #55129

Jean-MichelFauth mannequin opened this issue Jan 16, 2011 · 5 comments
Labels
OS-windows type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@Jean-MichelFauth
Copy link
Mannequin

Jean-MichelFauth mannequin commented Jan 16, 2011

BPO 10920
Nosy @pitrou, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2011-01-18.21:40:47.650>
created_at = <Date 2011-01-16.19:47:38.500>
labels = ['OS-windows', 'type-crash']
title = 'cp65001, PowerShell, Python crash.'
updated_at = <Date 2011-10-26.23:49:03.086>
user = 'https://bugs.python.org/Jean-MichelFauth'

bugs.python.org fields:

activity = <Date 2011-10-26.23:49:03.086>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2011-01-18.21:40:47.650>
closer = 'vstinner'
components = ['Windows']
creation = <Date 2011-01-16.19:47:38.500>
creator = 'Jean-Michel.Fauth'
dependencies = []
files = []
hgrepos = []
issue_num = 10920
keywords = []
message_count = 5.0
messages = ['126370', '126378', '126379', '126381', '146469']
nosy_count = 3.0
nosy_names = ['pitrou', 'vstinner', 'Jean-Michel.Fauth']
pr_nums = []
priority = 'high'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue10920'
versions = ['Python 3.2']

@Jean-MichelFauth
Copy link
Mannequin Author

Jean-MichelFauth mannequin commented Jan 16, 2011

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.

@Jean-MichelFauth Jean-MichelFauth mannequin added OS-windows type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 16, 2011
@pitrou
Copy link
Member

pitrou commented Jan 16, 2011

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.

@vstinner
Copy link
Member

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 bpo-1602 (especially msg120414 and msg126303), and maybe also issue bpo-6058.

@vstinner
Copy link
Member

If the "crash" is the following message, this issue is a duplicate of bpo-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 bpo-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 bpo-1602 for more information.

@vstinner
Copy link
Member

I added a cp65001 codec to Python 3.3: see issue bpo-13216. So Python will not "crash" anymore if the console code page is set to cp65001.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

2 participants