Ned Deily <n...@acm.org> added the comment:

I agree that it is kind of odd behavior and, after a quick look back through 
open issues, I was a bit surprised to not find an open issue about it (although 
I may have overlooked one).

"Thus it does not seem to be an os.system issue, but a failure of Idle to 
capture the sysoutput string as the interpreter does  The xterminal example 
highlights this.  The sysoutput is echoed at the xterminal not in idle."

The reason this is an issue is because the interpreter does *not* do anything 
special to capture stdout from subprocesses.  If you're running the interpreter 
in a terminal window both stdout from the interpreter process and, by default, 
stdout from any child processes, like those created by os.system or subprocess 
(if you don't override it), inherit the same stdout and so the output from both 
processes show up in the same place (i.e. terminal session) automatically.  
When running under IDLE though, IDLE uses its own proxy output object to 
intercept the output from the interpreter but does not do anything special for 
stdout from subprocesses so that output ends up in unexpected places: the 
terminal session from which IDLE was launched or the transient window on 
Windows or into the system log with the OS X IDLE.app.  I think IDLE could do a 
better job of intercepting stdout for these cases but it might be a bit tricky 
to make it work across all platforms.

----------
components:  -Interpreter Core
nosy: +ned.deily
stage:  -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11820>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to