I have a script _testing_.py containing just raise SystemExit
. When I run it from cmdline using py -i _testing_.py
, the traceback is printed and the the prompt >>> is printed. However when I run it as subprocess via Popen, i.e. Popen("py -i _testing_.py", stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
the resulting stderr contains first the prompt >>> and then the traceback. Can you confirm this behaviour and explain it? I'm using Python 3.3.2 on Windows.
It seems thats it's dependent bahaviour. @jentyk's observation is that the order isn't exchanged in Python 2.7 on MacOS.