classification
Title: python.exe stdout stderr issues again
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: SSmith, benjamin.peterson
Priority: normal Keywords:

Created on 2013-08-27 01:34 by SSmith, last changed 2014-01-28 18:47 by SSmith. This issue is now closed.

Messages (6)
msg196257 - (view) Author: SSmith (SSmith) Date: 2013-08-27 01:34
python.exe sends its output to stderr instead of stdout.
Writing the following to the command line highlight the issue:
[ in]>python.exe --version 1> null   #redirects stdout to null
[out]>Python 2.7.5

[ in]>python.exe --version 2> null   #redirects stderr to null
[out]>

Python 3.3 has exactly the same issue.

Python 3.4alpha now, although it gives the correct output with the --version switch...:
[ in]>python --version 1> null
[out]>

[ in]>python --version 2> null
[out]>Python 3.4.0a1

...still invoking a simple pyton.exe  (switchless), prints its default output to stderr:
[ in]>python 1> null
[out]>Python 3.4.0a1 (v3.4.0a1:46535f65e7f3, Aug  3 2013, 22:59:31) [MSC v.1600 32 bit (Intel)] on win32
[out]>Type "help", "copyright", "credits" or "license" for more information.
[out]>>>


[ in]>python 2> null
[out]>>>

Some notes/refs:
Incomplete fix in 3.4a http://bugs.python.org/issue18338
msg196260 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-08-27 03:15
Will be fixed in Python 3.4 per #18338
msg209552 - (view) Author: SSmith (SSmith) Date: 2014-01-28 15:14
Please pay some attention to this. This ISSUE is still valid in 3.4b4! Issue #18338 resolves only part of the problem. Look at this part of the OP:
invoking  python.exe   prints its default output to stderr:
[ in]>python 1> null
[out]>Python 3.4.0a1 (v3.4.0a1:46535f65e7f3, Aug  3 2013, 22:59:31) [MSC v.1600 32 bit (Intel)] on win32
[out]>Type "help", "copyright", "credits" or "license" for more information.
[out]>>>

[ in]>python 2> null
[out]>>>
msg209553 - (view) Author: SSmith (SSmith) Date: 2014-01-28 15:19
r/3.4b4/3.4b3
msg209554 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-01-28 15:28
Hmm, I'm not sure what the precedence is for that. Where do other interactive languages print their header to?
msg209574 - (view) Author: SSmith (SSmith) Date: 2014-01-28 18:47
Interestingly to me, you 're right!
Powershell interpreter does the same. Ironically, failure to launch  python  from Powershell ISE(Integrated Scripting Environment) was what triggered this bug report. And as I see know, PowershellISE doesnt support launching  a 'nested' powershell interpreter too.

You also direct python.exe verbose output to stderr too. If I uncderstand the 'problem' correctly, it seems that having  to choose from just 2 output channels leads to compromises like these.

Thanks for your time and apologies for bumping this twice!
History
Date User Action Args
2014-01-28 18:47:14SSmithsetmessages: + msg209574
2014-01-28 15:28:44benjamin.petersonsetmessages: + msg209554
2014-01-28 15:19:38SSmithsetmessages: + msg209553
2014-01-28 15:14:25SSmithsetmessages: + msg209552
2013-08-27 03:15:40benjamin.petersonsetstatus: open -> closed
versions: - Python 2.7, Python 3.3
nosy: + benjamin.peterson

messages: + msg196260

resolution: out of date
2013-08-27 01:34:25SSmithcreate