[issue6135] subprocess seems to use local encoding and give no choice

2012-08-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> > only one Popen instance (for the iconv call), but different encodings
> > for stdin and stdout.
> Isn't that the exception rather than the rule? I think it actually makes
> sense, in at least 99.83% of cases ;-), to have a common encoding
> setting for all streams.

FWIW, I recently encountered a scenario (albeit in a test situation) where the 
ability to set different encodings for stdout and stderr would have been useful 
to me.  It was while creating a test case for issue 15595.  I was changing the 
locale encoding for stdout, but I also wanted to leave it unchanged for stderr 
because there didn't seem to be a way to control the encoding that the child 
used for stderr.

--
nosy: +cjerdonek

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local encoding and give no choice

2012-08-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

To my previous comment, issue 15648 shows the case where I was able to change 
the encoding for stdout in the child process but not stderr (which would 
require supporting two encodings in Popen to handle).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local encoding and give no choice

2011-11-28 Thread Éric Araujo

Éric Araujo  added the comment:

So the users can control the encoding, and this is a doc bug.

--
title: subprocess seems to use local 8-bit encoding and gives no choice -> 
subprocess seems to use local encoding and give no choice

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local encoding and give no choice

2011-11-28 Thread R. David Murray

R. David Murray  added the comment:

If you decide this is only a doc bug, please see also related issue 12832.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local encoding and give no choice

2011-11-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So the users can control the encoding, and this is a doc bug.

Not really. People can control the encoding in the child process (and only if 
it's a Python 3 process of course).
They can't control the encoding in the parent's subprocess pipes and that's 
what the request (& patch) is about.

--
versions: +Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local encoding and give no choice

2013-01-17 Thread Joseph Perry

Joseph Perry added the comment:

I've found a workaround by specifying the enviroment variable:

my_env = os.environ
my_env['PYTHONIOENCODING'] = 'utf-8'
p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, stdin=subprocess.PIPE, env=my_env)

I've attached an example script for testing. It calls itself recursively 10 
times.
Pleased note the 'fix' variable.

--
nosy: +berwin22
Added file: http://bugs.python.org/file28760/subProcessTest.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com