Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
feac3980
Commit
feac3980
authored
Aug 27, 2014
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The webbrowser module now uses subprocess's start_new_session=True rather
than a potentially risky preexec_fn=os.setsid call.
parent
2ced87f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
Lib/webbrowser.py
Lib/webbrowser.py
+4
-11
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/webbrowser.py
View file @
feac3980
...
...
@@ -159,10 +159,8 @@ class BackgroundBrowser(GenericBrowser):
if
sys
.
platform
[:
3
]
==
'win'
:
p
=
subprocess
.
Popen
(
cmdline
)
else
:
setsid
=
getattr
(
os
,
'setsid'
,
None
)
if
not
setsid
:
setsid
=
getattr
(
os
,
'setpgrp'
,
None
)
p
=
subprocess
.
Popen
(
cmdline
,
close_fds
=
True
,
preexec_fn
=
setsid
)
p
=
subprocess
.
Popen
(
cmdline
,
close_fds
=
True
,
start_new_session
=
True
)
return
(
p
.
poll
()
is
None
)
except
OSError
:
return
False
...
...
@@ -321,11 +319,6 @@ class Konqueror(BaseBrowser):
action
=
"openURL"
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
)
if
not
setsid
:
setsid
=
getattr
(
os
,
'setpgrp'
,
None
)
try
:
p
=
subprocess
.
Popen
([
"kfmclient"
,
action
,
url
],
...
...
@@ -343,7 +336,7 @@ class Konqueror(BaseBrowser):
p
=
subprocess
.
Popen
([
"konqueror"
,
"--silent"
,
url
],
close_fds
=
True
,
stdin
=
devnull
,
stdout
=
devnull
,
stderr
=
devnull
,
preexec_fn
=
setsid
)
start_new_session
=
True
)
except
OSError
:
# fall through to next variant
pass
...
...
@@ -356,7 +349,7 @@ class Konqueror(BaseBrowser):
p
=
subprocess
.
Popen
([
"kfm"
,
"-d"
,
url
],
close_fds
=
True
,
stdin
=
devnull
,
stdout
=
devnull
,
stderr
=
devnull
,
preexec_fn
=
setsid
)
start_new_session
=
True
)
except
OSError
:
return
False
else
:
...
...
Misc/NEWS
View file @
feac3980
...
...
@@ -27,6 +27,9 @@ Core and Builtins
Library
-------
- The webbrowser module now uses subprocess'
s
start_new_session
=
True
rather
than
a
potentially
risky
preexec_fn
=
os
.
setsid
call
.
-
Issue
#
22236
:
Fixed
Tkinter
images
copying
operations
in
NoDefaultRoot
mode
.
-
Issue
#
22191
:
Fix
warnings
.
__all__
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment