[Python-checkins] bpo-34019: Fix wrong arguments for Opera Browser (#8047)
Pablo Galindo
webhook-mailer at python.org
Tue Jul 3 07:30:12 EDT 2018
https://github.com/python/cpython/commit/3cf1f154edb88c108877729ea09f4ac174697fea
commit: 3cf1f154edb88c108877729ea09f4ac174697fea
branch: master
author: Bumsik Kim <k.bumsik at gmail.com>
committer: Pablo Galindo <Pablogsal at gmail.com>
date: 2018-07-03T12:30:06+01:00
summary:
bpo-34019: Fix wrong arguments for Opera Browser (#8047)
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.
files:
A Misc/NEWS.d/next/Library/2018-07-02-05-59-11.bpo-34019.ZXJIife.rst
M Lib/test/test_webbrowser.py
M Lib/webbrowser.py
diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py
index 0820b9123125..7a396bdc4114 100644
--- a/Lib/test/test_webbrowser.py
+++ b/Lib/test/test_webbrowser.py
@@ -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):
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 2a5729b446f0..d717193d05c2 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -308,11 +308,10 @@ class Chrome(UnixBrowser):
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
index 000000000000..8a9fe79b80cf
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-07-02-05-59-11.bpo-34019.ZXJIife.rst
@@ -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.
More information about the Python-checkins
mailing list