cmdline = [self.name] + raise_opt + args
if remote or self.background:
- inout = io.open(os.devnull, "r+")
+ inout = subprocess.DEVNULL
else:
# for TTY browsers, we need stdin/out
inout = None
else:
action = "openURL"
- devnull = io.open(os.devnull, "r+")
+ devnull = subprocess.DEVNULL
# if possible, put browser in separate process group, so
# keyboard interrupts don't affect browser as well as Python
setsid = getattr(os, 'setsid', None)
Library
-------
+- Issue #15447: Use subprocess.DEVNULL in webbrowser, instead of opening
+ os.devnull explicitly and leaving it open.
+
- Issue #15509: webbrowser.UnixBrowser no longer passes empty arguments to
Popen when %action substitutions produce empty strings.