Does Python mess with the (unicode) code page?

R

Roy Smith

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

Gabriel Genellina

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.
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top