[Python-checkins] commit of r41419 - python/trunk/Lib

reinhold.birkenfeld@python.org reinhold.birkenfeld at python.org
Wed Nov 9 22:42:49 CET 2005


Author: reinhold.birkenfeld
Date: Wed Nov  9 22:42:48 2005
New Revision: 41419

Modified:
   python/trunk/Lib/webbrowser.py
Log:
Bug #1338995: fix problem with new webbrowser.py.




Modified: python/trunk/Lib/webbrowser.py
==============================================================================
--- python/trunk/Lib/webbrowser.py	(original)
+++ python/trunk/Lib/webbrowser.py	Wed Nov  9 22:42:48 2005
@@ -180,8 +180,11 @@
             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 @@
     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 @@
             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 @@
     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 @@
             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 @@
                     # 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


More information about the Python-checkins mailing list