[New-bugs-announce] [issue26189] Non-interactive interpreter returns control to cmd.exe early

Ivan Pozdeev report at bugs.python.org
Sat Jan 23 21:29:02 EST 2016


New submission from Ivan Pozdeev:

When running python.exe from windows console non-interactively, cmd.exe prompt appears immediately after starting:

C:\>python -c "import time; time.sleep(2); print 'bla-bla-bla'"

C:\>bla-bla-bla
<cursor here>

Not only this prevents from cmd to setting ERRORLEVEL to the return code, this makes it impossible to run scripts that expect input from console because Python and cmd get input lines in turns (I typed both inputs 2 times in the following example):

C:\>python -c "s=raw_input('1st:'); print s; s=raw_input('2nd:'); print s"

C:\>1st:abcdef
'abcdef' is not recognized as an internal or external command,
operable program or batch file.

C:\>abcdef
abcdef
2nd:123456
'123456' is not recognized as an internal or external command,
operable program or batch file.

C:\>123456
123456
<cursor here>

----------
components: IO
messages: 258880
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: Non-interactive interpreter returns control to cmd.exe early
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26189>
_______________________________________


More information about the New-bugs-announce mailing list