]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34019: Fix wrong arguments for Opera Browser (GH-8047)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Jul 2018 12:16:56 +0000 (05:16 -0700)
committerGitHub <noreply@github.com>
Tue, 3 Jul 2018 12:16:56 +0000 (05:16 -0700)
The Opera Browser was using a outdated command line invocation that resulted in an incorrect URL being opened in the browser when requested using the webbrowser module.

* Correct the arguments passed to the Opera Browser when opening a new URL.
(cherry picked from commit 3cf1f154edb88c108877729ea09f4ac174697fea)

Co-authored-by: Bumsik Kim <k.bumsik@gmail.com>
Lib/test/test_webbrowser.py
Lib/webbrowser.py
Misc/NEWS.d/next/Library/2018-07-02-05-59-11.bpo-34019.ZXJIife.rst [new file with mode: 0644]

index e46b6fb08938664d6ff2c3a326346cd4e5e2d12e..7cbb8d0a2957de6a8dd798544a195c6bbba17347 100644 (file)
@@ -170,23 +170,23 @@ class OperaCommandTest(CommandTestMixin, unittest.TestCase):
 
     def test_open(self):
         self._test('open',
-                   options=['-remote'],
-                   arguments=['openURL({})'.format(URL)])
+                   options=[],
+                   arguments=[URL])
 
     def test_open_with_autoraise_false(self):
         self._test('open', kw=dict(autoraise=False),
-                   options=['-remote', '-noraise'],
-                   arguments=['openURL({})'.format(URL)])
+                   options=[],
+                   arguments=[URL])
 
     def test_open_new(self):
         self._test('open_new',
-                   options=['-remote'],
-                   arguments=['openURL({},new-window)'.format(URL)])
+                   options=['--new-window'],
+                   arguments=[URL])
 
     def test_open_new_tab(self):
         self._test('open_new_tab',
-                   options=['-remote'],
-                   arguments=['openURL({},new-page)'.format(URL)])
+                   options=[],
+                   arguments=[URL])
 
 
 class ELinksCommandTest(CommandTestMixin, unittest.TestCase):
index 6f43b7f1265d1abdbb213b9e634bfa6d55122032..1a553f0e65ac9448da80fb3b9cfee640e57a193d 100755 (executable)
@@ -290,11 +290,10 @@ Chromium = Chrome
 class Opera(UnixBrowser):
     "Launcher class for Opera browser."
 
-    raise_opts = ["-noraise", ""]
-    remote_args = ['-remote', 'openURL(%s%action)']
+    remote_args = ['%action', '%s']
     remote_action = ""
-    remote_action_newwin = ",new-window"
-    remote_action_newtab = ",new-page"
+    remote_action_newwin = "--new-window"
+    remote_action_newtab = ""
     background = True
 
 
diff --git a/Misc/NEWS.d/next/Library/2018-07-02-05-59-11.bpo-34019.ZXJIife.rst b/Misc/NEWS.d/next/Library/2018-07-02-05-59-11.bpo-34019.ZXJIife.rst
new file mode 100644 (file)
index 0000000..8a9fe79
--- /dev/null
@@ -0,0 +1,2 @@
+webbrowser: Correct the arguments passed to Opera Browser when opening a new URL
+using the ``webbrowser`` module. Patch by Bumsik Kim.