Skip to content

Commit 3cf1f15

Browse files
kbumsikpablogsal
authored andcommitted
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.
1 parent 23401fb commit 3cf1f15

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

Lib/test/test_webbrowser.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,23 @@ class OperaCommandTest(CommandTestMixin, unittest.TestCase):
170170

171171
def test_open(self):
172172
self._test('open',
173-
options=['-remote'],
174-
arguments=['openURL({})'.format(URL)])
173+
options=[],
174+
arguments=[URL])
175175

176176
def test_open_with_autoraise_false(self):
177177
self._test('open', kw=dict(autoraise=False),
178-
options=['-remote', '-noraise'],
179-
arguments=['openURL({})'.format(URL)])
178+
options=[],
179+
arguments=[URL])
180180

181181
def test_open_new(self):
182182
self._test('open_new',
183-
options=['-remote'],
184-
arguments=['openURL({},new-window)'.format(URL)])
183+
options=['--new-window'],
184+
arguments=[URL])
185185

186186
def test_open_new_tab(self):
187187
self._test('open_new_tab',
188-
options=['-remote'],
189-
arguments=['openURL({},new-page)'.format(URL)])
188+
options=[],
189+
arguments=[URL])
190190

191191

192192
class ELinksCommandTest(CommandTestMixin, unittest.TestCase):

Lib/webbrowser.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,10 @@ class Chrome(UnixBrowser):
308308
class Opera(UnixBrowser):
309309
"Launcher class for Opera browser."
310310

311-
raise_opts = ["-noraise", ""]
312-
remote_args = ['-remote', 'openURL(%s%action)']
311+
remote_args = ['%action', '%s']
313312
remote_action = ""
314-
remote_action_newwin = ",new-window"
315-
remote_action_newtab = ",new-page"
313+
remote_action_newwin = "--new-window"
314+
remote_action_newtab = ""
316315
background = True
317316

318317

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
webbrowser: Correct the arguments passed to Opera Browser when opening a new URL
2+
using the ``webbrowser`` module. Patch by Bumsik Kim.

0 commit comments

Comments
 (0)