Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #39865

Re: webbrowser.open("./documentation/help.html")-- No Go in Windows

Newsgroups comp.lang.python
Date 2013-02-24 17:03 -0800
References <659b4770-12fb-400f-8aa5-049605347fe2@googlegroups.com> <mailman.2401.1361698540.2939.python-list@python.org> <5fbb36fe-a2b3-4ea6-a42e-53d46845865e@googlegroups.com> <mailman.2445.1361744102.2939.python-list@python.org>
Subject Re: webbrowser.open("./documentation/help.html")-- No Go in Windows
From llanitedave <llanitedave@veawb.coop>
Message-ID <mailman.2484.1361759307.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Sunday, February 24, 2013 2:15:10 PM UTC-8, MRAB wrote:
> On 2013-02-24 20:28, llanitedave wrote:
> 
> > On Sunday, February 24, 2013 1:35:31 AM UTC-8, Chris Rebert wrote:
> 
> [snip]
> 
> >> Sounds like this might be your problem:
> 
> >>
> 
> >> http://bugs.python.org/issue8936
> 
> >>
> 
> >> The fix would seem to be ensuring that the URL you pass includes
> 
> >> the scheme (in your case, "file:").
> 
> >>
> 
> > Holy Toledo!  That's a two-year-old bug spanning two versions of the
> 
> > language!
> 
> >
> 
> > BTW, Chris, the snippet I showed in the title essentially WAS the
> 
> > exact code.  It's a method with that single line called from a
> 
> > wxPython Help menu.  I can't really put an absolute pathname into the
> 
> > argument, because the application is going to be distributed to a
> 
> > variety of computers at my workplace, and there's no assurance that
> 
> > it will go into (or remain in)a particular folder.
> 
> >
> 
> > I was trying to avoid using the wx.html.HtmlWindow feature of
> 
> > wxPython, because it doesn't handle CSS and styles.  My help page is
> 
> > the portal to a multi-page users guide with a style sheet to render
> 
> > all the content consistently.
> 
> >
> 
> > Plus, I couldn't get the wx.html.HtmlWindow to open relative paths
> 
> > either -- it gave me "URL Malformed" messages even in KDE, when
> 
> > webbrowser.open("filepath") was working for the exact same path.  But
> 
> > that's something to take up on the wxPython list, I guess.
> 
> >
> 
> > This to me illustrates the downside of the Python philosophy of
> 
> > "There should be only one obvious way to do things".  If that one
> 
> > obvious way has a fatal bug, you're pretty much SOL.
> 
> >
> 
> I've had a brief look at webbrowser.py. It's looking for the browsers in 
> 
> the paths listed in the PATH environment variable.
> 
> 
> 
> On my PC at least, the paths to the other browsers, such as "C:\Program
> 
> Files\Mozilla Firefox" for Firefox, aren't listed there, hence the only
> 
> one it can find is Internet Explorer.

Well, it's still very odd, because when I use wxPython's wx.html.HtmlWindow to click a web link, it DOES use the default browser, which is Chrome on my PC.  It's just using the webbrowser.open() function that goes to IE.  Until then, I'd been suspecting that wx.html.HtmlWindow was using webbrowser.open() under the hood.  I guess not.

But wx.html.HtmlWindow doesn't work on relative paths, it seems (in neither Linux NOR Windows), so I'm not able to find a substitute as of yet.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

webbrowser.open("./documentation/help.html")--  No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 01:17 -0800
  Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Chris Rebert <clp2@rebertia.com> - 2013-02-24 01:24 -0800
  Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Demian Brecht <demianbrecht@gmail.com> - 2013-02-24 01:25 -0800
  Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Chris Rebert <clp2@rebertia.com> - 2013-02-24 01:35 -0800
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 12:28 -0800
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-02-24 20:50 +0000
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 13:06 -0800
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 13:06 -0800
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Chris Rebert <clp2@rebertia.com> - 2013-02-24 12:48 -0800
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 13:04 -0800
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 13:04 -0800
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows MRAB <python@mrabarnett.plus.com> - 2013-02-24 22:15 +0000
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 17:03 -0800
        Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 17:03 -0800
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Terry Reedy <tjreedy@udel.edu> - 2013-02-25 00:36 -0500
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 12:28 -0800
  Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Demian Brecht <demianbrecht@gmail.com> - 2013-02-24 15:51 -0800
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 18:26 -0800
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 18:26 -0800
  Re: webbrowser.open("./documentation/help.html")--  No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 19:37 -0800
    Re: webbrowser.open("./documentation/help.html")--  No Go in Windows Matej Cepl <mcepl@redhat.com> - 2013-02-26 14:15 +0100
  Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Terry Reedy <tjreedy@udel.edu> - 2013-02-25 00:35 -0500
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 22:26 -0800
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Chris Angelico <rosuav@gmail.com> - 2013-02-25 17:37 +1100
      Re: webbrowser.open("./documentation/help.html")-- No Go in Windows Terry Reedy <tjreedy@udel.edu> - 2013-02-25 06:10 -0500
    Re: webbrowser.open("./documentation/help.html")-- No Go in Windows llanitedave <llanitedave@veawb.coop> - 2013-02-24 22:26 -0800

csiph-web