mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'.
This commit is contained in:
parent
5e0b865b0f
commit
972ca507aa
1 changed files with 6 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
"""Interfaces for launching and remotely controlling Web browsers."""
|
"""Interfaces for launching and remotely controlling Web browsers."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -32,7 +33,11 @@ def get(using=None):
|
||||||
for browser in alternatives:
|
for browser in alternatives:
|
||||||
if '%s' in browser:
|
if '%s' in browser:
|
||||||
# User gave us a command line, split it into name and args
|
# User gave us a command line, split it into name and args
|
||||||
return GenericBrowser(browser.split())
|
browser = shlex.split(browser)
|
||||||
|
if browser[-1] == '&':
|
||||||
|
return BackgroundBrowser(browser[:-1])
|
||||||
|
else:
|
||||||
|
return GenericBrowser(browser)
|
||||||
else:
|
else:
|
||||||
# User gave us a browser name or path.
|
# User gave us a browser name or path.
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue