summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-11-09 21:42:48 (GMT)
committerGeorg Brandl <georg@python.org>2005-11-09 21:42:48 (GMT)
commit1cb179e93fb0f698fdb5f215b3864c578d910d9a (patch)
tree73142be8a4d2c466f27d4b44edb6db5813595262 /Lib
parent966c264b024102ab2e7cf3e5ed274f88d976f2b8 (diff)
downloadcpython-1cb179e93fb0f698fdb5f215b3864c578d910d9a.zip
cpython-1cb179e93fb0f698fdb5f215b3864c578d910d9a.tar.gz
cpython-1cb179e93fb0f698fdb5f215b3864c578d910d9a.tar.bz2
Bug #1338995: fix problem with new webbrowser.py.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/webbrowser.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 1db52d0..afc25ba 100644
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -180,8 +180,11 @@ class UnixBrowser(BaseBrowser):
cmd += ' &'
rc = os.system(cmd)
if rc:
+ cmd = "%s %s" % (self.name, url)
+ if self.remote_background:
+ cmd += " &"
# bad return status, try again with simpler command
- rc = os.system("%s %s" % (self.name, url))
+ rc = os.system(cmd)
return not rc
def open(self, url, new=0, autoraise=1):
@@ -209,6 +212,7 @@ class Mozilla(UnixBrowser):
remote_action = "openURL(%s)"
remote_action_newwin = "openURL(%s,new-window)"
remote_action_newtab = "openURL(%s,new-tab)"
+ remote_background = True
Netscape = Mozilla
@@ -240,7 +244,7 @@ class Konqueror(BaseBrowser):
if _iscommand("konqueror"):
rc = os.system(self.name + " --silent '%s' &" % url)
elif _iscommand("kfm"):
- rc = os.system(self.name + " -d '%s'" % url)
+ rc = os.system(self.name + " -d '%s' &" % url)
return not rc
def open(self, url, new=0, autoraise=1):
@@ -264,6 +268,7 @@ class Opera(UnixBrowser):
remote_action = "openURL(%s)"
remote_action_newwin = "openURL(%s,new-window)"
remote_action_newtab = "openURL(%s,new-page)"
+ remote_background = True
class Elinks(UnixBrowser):
@@ -459,7 +464,7 @@ if sys.platform == 'darwin':
new = int(bool(new))
if self.name == "default":
# User called open, open_new or get without a browser parameter
- script = _safequote('open location "%s"', url) # opens in default browser
+ script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
else:
# User called get and chose a browser
if self.name == "OmniWeb":
@@ -468,7 +473,7 @@ if sys.platform == 'darwin':
# Include toWindow parameter of OpenURL command for browsers
# that support it. 0 == new window; -1 == existing
toWindow = "toWindow %d" % (new - 1)
- cmd = _safequote('OpenURL "%s"', url)
+ cmd = 'OpenURL "%s"' % url.replace('"', '%22')
script = '''tell application "%s"
activate
%s %s