Issue 1602, cp65001, powershell and python3 crash

Discussion in 'Python' started by jmfauth, Jan 16, 2011.

  1. jmfauth

    jmfauth Guest

    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
     
    jmfauth, Jan 16, 2011
    #1
    1. Advertising

  2. jmfauth

    Terry Reedy Guest

    On 1/16/2011 4:22 AM, jmfauth wrote:
    > 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?


    --
    Terry Jan Reedy
     
    Terry Reedy, Jan 16, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BartlebyScrivener

    Python and Windows new Powershell

    BartlebyScrivener, May 2, 2006, in forum: Python
    Replies:
    1
    Views:
    281
    BartlebyScrivener
    May 2, 2006
  2. Python or PowerShell ?

    , Jan 8, 2008, in forum: Python
    Replies:
    5
    Views:
    342
    Martin P. Hellwig
    Jan 10, 2008
  3. Guillermo
    Replies:
    6
    Views:
    423
    Lawrence D'Oliveiro
    May 12, 2010
  4. Nicholas Calvert
    Replies:
    5
    Views:
    184
    Jano Svitok
    Jun 20, 2008
  5. Catsquotl

    powershell and ri

    Catsquotl, Feb 27, 2011, in forum: Ruby
    Replies:
    1
    Views:
    113
    Phillip Gawlowski
    Feb 27, 2011
Loading...

Share This Page