diff options
author | Georg Brandl <georg@python.org> | 2007-03-21 11:52:38 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-21 11:52:38 (GMT) |
commit | 9225f226a3a6173e277374fc8fc2ea6c7c1cecbf (patch) | |
tree | 2b5173fbb42b2ee9269865dd7a19055e879c6f9b /Lib | |
parent | bd9d51321e062e530a75f25ab0beb7c07b0f04a4 (diff) | |
download | cpython-9225f226a3a6173e277374fc8fc2ea6c7c1cecbf.zip cpython-9225f226a3a6173e277374fc8fc2ea6c7c1cecbf.tar.gz cpython-9225f226a3a6173e277374fc8fc2ea6c7c1cecbf.tar.bz2 |
Bug #1684254: webbrowser now uses shlex to split any command lines
given to get(). It also detects when you use '&' as the last argument
and creates a BackgroundBrowser then.
(backport -- this is a regression from 2.4 and therefore backported)
Diffstat (limited to 'Lib')
-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 3735587..b71ef8d 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: |