Minimum working example:
test.bat:
@echo off
if 0==0 (
  timeout 3
  python test.py
)
test.py:
input('press ENTER to exit')
In cmd.exe:
call test.bat
> Waiting for 0 seconds, press a key to continue ...
> press ENTER to exit_
Then it's stuck at the input statement. If I keep pressing enter, it will eventually raise an exception:
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    input('press ENTER to exit')
OSError: [WinError 8] Not enough storage is available to process this command
I'm on Windows 7 SP1, tried it with
- Python 3.6 (64-bit)
 - Python 3.6 (32-bit)
 - Python 3.5 (32-bit)
 - Python 2.7 (32-bit) (in this case it's stuck forever without raising exception)
 
Can anyone reproduce this and/or have any idea where it went wrong?