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
Traceback (most recent call last):
File "../_timeout.py", line 8, in <module>
subprocess.check_call('sleep 10', shell=True, timeout=1)
File "/usr/lib64/python3.8/subprocess.py", line 359, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib64/python3.8/subprocess.py", line 342, in call
return p.wait(timeout=timeout)
File "/home/dtantsur/Projects/oslo.concurrency/.tox/py3/lib/python3.8/site-packages/eventlet/green/subprocess.py", line 90, in wait
raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command 'sleep 10' timed out after 1 seconds
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../_timeout.py", line 12, in <module>
assert exc.__class__ is subprocess.TimeoutExpired, exc.__class__
AssertionError: <class 'subprocess.TimeoutExpired'>
Using
fromeventlet.greenimportsubprocess
fixes the problem but assumes modifying the code which is supposed to work after monkey patching.
The text was updated successfully, but these errors were encountered:
This issue seems highly dependent the presence of a virtual env (and moon phases). I could not reproduce it with system python and eventlet on my Fedora, but can easily reproduce in a fresh venv.
I do wonder if we should avoid overriding TimeoutExpired for Python's that have it.
dtantsur
changed the title
Monkey patching breaks usage of subprocess.TimeoutExpired
Monkey patching breaks usage of subprocess.TimeoutExpired in a virtual env
Jul 6, 2020
Reproducer (on Python 3.8 for me, also seems to reproduce on 3.6):
Expected: "okay" printed.
Actual:
Using
fixes the problem but assumes modifying the code which is supposed to work after monkey patching.
The text was updated successfully, but these errors were encountered: