FAQ
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.

Search Discussions

  • Gabriel Genellina at Dec 8, 2009 at 8:12 pm

    En Thu, 03 Dec 2009 15:38:28 -0300, Roy Smith <roy at panix.com> 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 3, '09 at 6:38p
activeDec 8, '09 at 8:12p
posts2
users2
websitepython.org

2 users in discussion

Roy Smith: 1 post Gabriel Genellina: 1 post

People

Translate

site design / logo © 2022 Grokbase