[issue15509] webbrowser.open sometimes passes zero-length argument to the browser.

Anton Barkovsky report at bugs.python.org
Tue Jul 31 00:35:18 CEST 2012


New submission from Anton Barkovsky:

Because of the way webbrowser.UnixBrowser.open generates command-line
arguments the resulting list sometimes looks like this:

  ['chromium', '', 'http://www.example.org/']

This seems to work fine with chromium for me but as you can see:

  >>> subprocess.call(['ls', '', '-l'])
  ls: cannot access : No such file or directory
  2

It's not a good idea to rely on that.
I'm attaching a patch that filters out those empty arguments.

----------
components: Library (Lib)
files: webbrowser_args.patch
keywords: patch
messages: 166930
nosy: anton.barkovsky
priority: normal
severity: normal
status: open
title: webbrowser.open sometimes passes zero-length argument to the browser.
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file26607/webbrowser_args.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15509>
_______________________________________


More information about the Python-bugs-list mailing list