From: Georg Brandl Date: Wed, 21 Mar 2007 11:51:25 +0000 (+0000) Subject: Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'. X-Git-Tag: v2.6a1~1955 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=972ca507aa9fe0aedc0d614b8837d11bf41f0f24;p=thirdparty%2FPython%2Fcpython.git Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'. --- diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 180803c2544a..209cb17b6ad0 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: