-
Notifications
You must be signed in to change notification settings - Fork 578
Closed
Labels
Description
- uvloop version: 0.4.33
- python version: 3.5
- platform: Mac OSX 10.11
Creating a uvloop.Loop
has the surprising side effect of marking file descriptors it doesn't own (notably including stdin/out/err) as FD_CLOEXEC
. This causes any use of subprocesses which do not explicitly assign stdin/out/err to fail, sometimes in surprising ways. This toy example should print "hi", but does nothing if a uvloop.Loop
has been created. In more complex examples a subprocess may open other files or sockets, those sockets get assigned the first three file descriptors, and its stdio output gets interleaved with its network traffic.
import uvloop
import subprocess
uvloop.Loop()
p = subprocess.Popen(["echo", "hi"])
p.wait()