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
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top