Re: webbrowser module bug?



Ron Adam wrote:

Reseting the default browser with the gnome default application window
confirmed this. The browser selection can either have the quotes around
the args "%s" paremteter, or not depending on how and what sets it.

Seems to me it should be quoted unless spaces in path names are never a
problem in Linux. So this could be both a python bug and a Gnome desktop
bug. Firefox probably does the right thing by putting the quotes around
it, but that causes problems for webbrowser.py, which doesn't expect them.

Quoting arguments in the way described is the safe, easy option (with
some potential problems with ' characters that can be worked around),
and I imagine that it's done precisely because other applications
could pass a path with spaces as the URL, and that such applications
would be invoking the command in a shell environment. Sadly, this
conflicts with any other precautionary measures, causing a degree of
"overquoting".

Resetting the GNOME default is a workaround, but I'm not convinced
that it would be satisfactory. What happens if you try and open an
HTML file, in the file browser or some other application which uses
the desktop preferences, where the filename contains spaces?

Paul

.



Relevant Pages

  • Re: webbrowser module bug?
    ... It looks like the problem started when I told firefox to make itself the default browser. ... So instead of trying them in order, it asked the gnome configure tool for it. ... The browser selection can either have the quotes around the args "%s" paremteter, or not depending on how and what sets it. ... Firefox probably does the right thing by putting the quotes around it, but that causes problems for webbrowser.py, which doesn't expect them. ...
    (comp.lang.python)
  • Re: webbrowser module bug?
    ... So this could be both a python bug and a Gnome desktop ... Firefox probably does the right thing by putting the quotes around ... in the file browser or some other application which uses ... The webbrowser module needs to be smarter about quotes. ...
    (comp.lang.python)
  • Re: Empty div for holding a background strip of pics...
    ... Neredbojias ... In all browsers I have bar one, the background image in this div ... to it and it was that it was the only browser that did not like ... I've had trouble with quotes on background images, ...
    (alt.html)
  • Re: Switch to Sarge lost browser link in Mutt
    ... More likely it is the terminal window, ... This is gnome-terminal's doing, whether running under Gnome or not. ... You need to select a browser in the Gnome control center. ... Pax vobiscum; pax cum omnibus. ...
    (Debian-User)
  • Re: Double query form, result of 1st query drops anything after a space
    ... Man I love the internet. ... So to tell the browser, that all the words belong to the one ... just put quotes around them. ... > that exist there and how to secure your scripts. ...
    (comp.lang.php)