From b30b75ebc5a48cc03287123a9529aecb05ca1ad3 Mon Sep 17 00:00:00 2001 From: Alexey Kotlyarov Date: Mon, 21 Dec 2015 13:32:13 +1100 Subject: [PATCH] Do not pass open file descriptors to Xvfb Explicitly pass close_fds=True so that Xvfb does not inherit the open file descriptors of the calling process. --- xvfbwrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xvfbwrapper.py b/xvfbwrapper.py index f8cbce4..143c248 100644 --- a/xvfbwrapper.py +++ b/xvfbwrapper.py @@ -50,7 +50,8 @@ class Xvfb: with open(os.devnull, 'w') as fnull: self.proc = subprocess.Popen(self.xvfb_cmd, stdout=fnull, - stderr=fnull) + stderr=fnull, + close_fds=True) time.sleep(0.2) # give Xvfb time to start ret_code = self.proc.poll() if ret_code is None: