This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: regression in webbrowser command line parsing
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, luks
Priority: normal Keywords:

Created on 2007-03-20 11:09 by luks, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
webbrowser-cmdline.diff luks, 2007-03-20 11:09
Messages (3)
msg31592 - (view) Author: Lukas Lalinsky (luks) Date: 2007-03-20 11:09
With Python 2.4 it was common to use BROWSER environment variables like:

BROWSER="firefox '%s' &"

to launch a browser. The apostrophes around %s are required to escape special characters in the URL (because the command is launched using os.system, which uses a shell), and & at the end is required to not block GUI applications. However, in Python 2.5 it uses the subprocess module, and the example above doesn't work. It tries to open `firefox 'URL' &` literally, which causes Firefox to open URIs like file:///path/to/current/directory/'URL'.

Attached a patch that fixes the problem.
msg31593 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-21 11:53
Thanks for the report, fixed it using shlex in rev. 54485, 54486 (2.5).
msg31594 - (view) Author: Lukas Lalinsky (luks) Date: 2007-03-21 11:57
Oh, I didn't know about shlex.split. Thanks.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44746
2007-03-20 11:09:15lukscreate