Skip to content

UVLoop sets FD_CLOEXEC on descriptors it doesn't own #40

@bdarnell

Description

@bdarnell
  • 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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions