Issue 1602, cp65001, powershell and python3 crash


J

jmfauth

After having read the discussion about the issue 1602,
http://bugs.python.org/issue1602, I came to the idea
to test Python with the PowerShell. I thought, it
could help and manage "unicode" better than the
std "dosbox" does

My experience with PowerShell is closed to zero, so
take the following as a flat raw information.

1) Setup the coding in PowerShell (font: Consolas)

PS D:\jm> $OutputEncoding


IsSingleByte : True
BodyName : us-ascii
EncodingName : US-ASCII
HeaderName : us-ascii
WebName : us-ascii
WindowsCodePage : 1252
IsBrowserDisplay : False
IsBrowserSave : False
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 20127

PS D:\jm> chcp 65001
Page de codes active : 65001

PS D:\jm> $OutputEncoding = [Console]::OutputEncoding
PS D:\jm> $OutputEncoding


BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001


So far, so good. It seems I can enter and display "unicode
characters" (as opposed to cp850).

PS D:\jm> echo 'abc逜Üß'
abc逜Üß
PS D:\jm> chcp
Page de codes active : 65001
PS D:\jm>

2) Python test

PS D:\jm> c:\python31\python.exe
Fatal Python error: Py_Initialize: can't initialize sys standard
streams
LookupError: unknown encoding: cp65001

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.
PS D:\jm>

Obviously and expectedly Python does not recognize cp65001.
That's not the problem.

The main concern is, Python crashes with the usual msgbox,
"python.exe has stopped working ..." .

win7 pro (32 bits), Swiss French setup, cp850/cp1252, Python 3.1.2 .

Take this a raw information and do not ask me what's happen
behind the scene.

Last minute info:
Python 3.2.rc1: same behaviour.

jmf
 
Ad

Advertisements

T

Terry Reedy

After having read the discussion about the issue 1602,
http://bugs.python.org/issue1602, I came to the idea
to test Python with the PowerShell. I thought, it
could help and manage "unicode" better than the
std "dosbox" does

My experience with PowerShell is closed to zero, so
take the following as a flat raw information.

1) Setup the coding in PowerShell (font: Consolas)

PS D:\jm> $OutputEncoding


IsSingleByte : True
BodyName : us-ascii
EncodingName : US-ASCII
HeaderName : us-ascii
WebName : us-ascii
WindowsCodePage : 1252
IsBrowserDisplay : False
IsBrowserSave : False
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 20127

PS D:\jm> chcp 65001
Page de codes active : 65001

PS D:\jm> $OutputEncoding = [Console]::OutputEncoding
PS D:\jm> $OutputEncoding


BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001


So far, so good. It seems I can enter and display "unicode
characters" (as opposed to cp850).

PS D:\jm> echo 'abc逜Üß'
abc逜Üß
PS D:\jm> chcp
Page de codes active : 65001
PS D:\jm>

2) Python test

PS D:\jm> c:\python31\python.exe
Fatal Python error: Py_Initialize: can't initialize sys standard
streams
LookupError: unknown encoding: cp65001

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.
PS D:\jm>

Obviously and expectedly Python does not recognize cp65001.
That's not the problem.

The main concern is, Python crashes with the usual msgbox,
"python.exe has stopped working ..." .

win7 pro (32 bits), Swiss French setup, cp850/cp1252, Python 3.1.2 .

Take this a raw information and do not ask me what's happen
behind the scene.

Last minute info:
Python 3.2.rc1: same behaviour.

Could you add this report, slightly condensed, to the issue?
 

Top