New submission from Aaron Bingham: Under Gnome, Firefox will open the wrong URL when launched by webbrowser. For example after running the following interactive session:
[EMAIL PROTECTED]:~> python Python 2.5.1 (r251:54863, Jun 6 2007, 13:42:30) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import webbrowser >>> webbrowser.open('http://www.python.org') True Firefox attempts to open the URL file:///home/bingham/%22http://www.python.org%22. This is caused by a bug in the Python standard library's webbrowser module that only affects machines running Gnome. On Gnome, webbrowser runs the command gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null to find the web browser, which prints out a browser command line like /pkgs/Firefox/2.0/firefox "%s" The quotes around "%s" are preserved when passing the command-line arguments. The quotes prevent firefox from recognizing the URL and firefox falls back to treating it as a file name. The webbrowser module already handles extra quoting around the URL for the BROWSER environment variable and this same treatment should be applied to the result of gconftool-2. The BROWSER environment variable issue, now fixed, is described at http://bugs.python.org/issue1684254. The present issue was discussed in an Ubuntu bug report (https://bugs.launchpad.net/ubuntu/+source/python2.5/+bug/83974) but was not resolved. ---------- components: Library (Lib) messages: 55421 nosy: bingham severity: normal status: open title: Incorrect URL with webbrowser and firefox under Gnome type: behavior versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1057> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com