You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on Linux, the code followed could run and finished normally.
But on Windows, the patched subprocess.Popen function will block thread when trying to send some bytes to process object,
and it will be ok if stdin input was not used or just delete the eventlet.monkey_patch().
======================================================================
ERROR: test_communicate (__main__.EventletTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Library\eventlet1\test_1.py", line 12, in test_communicate
r = p.communicate(b'uname -a', timeout=1)
File "C:\Root\python\3.10.11\lib\subprocess.py", line 1173, in communicate
sts = self.wait(timeout=self._remaining_time(endtime))
File "C:\Root\python\virtualzone\tech310\lib\site-packages\eventlet\green\subprocess.py", line 90, inwait
raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command '['cmd']' timed out after -94.06300000002375 seconds
----------------------------------------------------------------------
Ran 2 tests in 95.104s
FAILED (errors=1)
if Ctrl+C pressed during the state of block, and kill cmd.exe, output would change to:
Exception in thread Thread-1 (_readerthread):
Traceback (most recent call last):
File "C:\Root\python\3.10.11\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Root\python\3.10.11\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Root\python\3.10.11\lib\subprocess.py", line 1515, in _readerthread
buffer.append(fh.read())
KeyboardInterrupt
(None, b'')
The text was updated successfully, but these errors were encountered:
version
Python==3.10.11, 3.8.10
eventlet==0.33.3
greenlet==2.0.2
dnspython==2.3.0
Tested on (Windows 10 LTSC)
problem
on Linux, the code followed could run and finished normally.
But on Windows, the patched
subprocess.Popen
function will block thread when trying to send some bytes to process object,and it will be ok if stdin input was not used or just delete the
eventlet.monkey_patch()
.save the unittest code to file named as
test_1.py
and run it withpython test_1.py -v
,will get blocked command output like these on windows:
python .\test_1.py -v test_communicate (__main__.EventletTestCase) ...
manually kill the blocked cmd.exe, it goes like:
if
Ctrl+C
pressed during the state of block, and kill cmd.exe, output would change to:The text was updated successfully, but these errors were encountered: