diff options
author | Georg Brandl <georg@python.org> | 2007-03-21 11:51:25 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-21 11:51:25 (GMT) |
commit | 972ca507aa9fe0aedc0d614b8837d11bf41f0f24 (patch) | |
tree | 9a316c44c59d1b1f78e912ade32e5a5e319f6137 /Lib/webbrowser.py | |
parent | 5e0b865b0fb7902b8f38f5c34f0f05ef66c4d142 (diff) | |
download | cpython-972ca507aa9fe0aedc0d614b8837d11bf41f0f24.zip cpython-972ca507aa9fe0aedc0d614b8837d11bf41f0f24.tar.gz cpython-972ca507aa9fe0aedc0d614b8837d11bf41f0f24.tar.bz2 |
Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'.
Diffstat (limited to 'Lib/webbrowser.py')
-rw-r--r-- | Lib/webbrowser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 180803c..209cb17 100644 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -2,6 +2,7 @@ """Interfaces for launching and remotely controlling Web browsers.""" import os +import shlex import sys import stat import subprocess @@ -32,7 +33,11 @@ def get(using=None): for browser in alternatives: if '%s' in browser: # 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: # User gave us a browser name or path. try: |