Does Python mess with the (unicode) code page?

Discussion in 'Python' started by Roy Smith, Dec 3, 2009.

  1. Roy Smith

    Roy Smith Guest

    We've got a windows executable which used to get run out of a shell script
    (Cygwin bash) and is now being run with subprocess.Popen(). The windows
    app is misbehaving. To make a long story short, the guy who wrote the code
    in question says,

    > it's all based on the return values of the WinAPI calls GetACP and GetOEMCP
    > [...] so maybe Python is doing something like setting the active code page
    > and OEM code page prior to the point when they "exec" stuff?


    Does Python do these things? I'm using Python 2.5.1.
     
    Roy Smith, Dec 3, 2009
    #1
    1. Advertising

  2. En Thu, 03 Dec 2009 15:38:28 -0300, Roy Smith <> escribió:

    > We've got a windows executable which used to get run out of a shell
    > script
    > (Cygwin bash) and is now being run with subprocess.Popen(). The windows
    > app is misbehaving. To make a long story short, the guy who wrote the
    > code
    > in question says,
    >
    >> it's all based on the return values of the WinAPI calls GetACP and
    >> GetOEMCP
    >> [...] so maybe Python is doing something like setting the active code
    >> page
    >> and OEM code page prior to the point when they "exec" stuff?

    >
    > Does Python do these things? I'm using Python 2.5.1.


    Not that I know of (also, I don't know of any way to programmatically
    alter GetACP and GetOEMCP, they're global system settings).

    A console application should use the console functions GetConsoleCP and
    GetConsoleOutputCP; Python itself calls them to derive sys.stdin.encoding
    and sys.stdout.encoding respectively, but only queries the value, never
    sets it. GetConsoleCP isn't necesarily the same as GetOEMCP.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Dec 8, 2009
    #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. Mickey Segal

    Does FrontPage mess up JSP code?

    Mickey Segal, Aug 2, 2004, in forum: Java
    Replies:
    8
    Views:
    829
    John C. Bollinger
    Aug 3, 2004
  2. damjan

    unicode mess in c++

    damjan, May 11, 2006, in forum: C++
    Replies:
    12
    Views:
    606
  3. Eric von Horst
    Replies:
    3
    Views:
    864
    Eric von Horst
    Feb 28, 2008
  4. Gilles Ganault

    Does Python mess with CRLFs?

    Gilles Ganault, Nov 12, 2008, in forum: Python
    Replies:
    4
    Views:
    316
    Irmen de Jong
    Nov 12, 2008
  5. DFS
    Replies:
    92
    Views:
    383
    BartC
    Jun 17, 2014
Loading...

Share This Page