X-Received: by 10.224.175.65 with SMTP id w1mr6822028qaz.7.1361737702524; Sun, 24 Feb 2013 12:28:22 -0800 (PST) X-Received: by 10.49.24.14 with SMTP id q14mr639275qef.17.1361737702487; Sun, 24 Feb 2013 12:28:22 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!news.glorb.com!t2no4658059qal.0!news-out.google.com!t2ni671qaj.0!nntp.google.com!dd2no2730461qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Sun, 24 Feb 2013 12:28:22 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.162.99.34; posting-account=aw7wEQoAAACnaP8vftI9MyiC9NfXNJyr NNTP-Posting-Host: 66.162.99.34 References: <659b4770-12fb-400f-8aa5-049605347fe2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5fbb36fe-a2b3-4ea6-a42e-53d46845865e@googlegroups.com> Subject: Re: webbrowser.open("./documentation/help.html")-- No Go in Windows From: llanitedave Cc: llanitedave , Python Injection-Date: Sun, 24 Feb 2013 20:28:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.python:39782 On Sunday, February 24, 2013 1:35:31 AM UTC-8, Chris Rebert wrote: > On Feb 24, 2013 1:21 AM, "llanitedave" wrote: >=20 > > >=20 > > I created an html help page for my Python 2.7.3 application and put it = in a documentation folder. =A0I used webbrowser.open() to fetch the page. >=20 > > >=20 > > On linux -- KDE specifically, the command opens the local file on my de= fault browser with no issues. =A0However, on Windows 7, it opens Internet E= xplorer, which doesn't even search the local folder, but goes straight to t= he web and does a Google search, returning nothing but useless noise. >=20 >=20 > > >=20 > > My default browser on Windows is Chrome, so my intention is getting und= ermined right from the start. >=20 > > >=20 > > How do I get a local html file to open properly from Python in Windows? >=20 > Sounds like this might be your problem: >=20 > http://bugs.python.org/issue8936 >=20 > The fix would seem to be ensuring that the URL you pass includes the sche= me (in your case, "file:"). >=20 > Cheers, >=20 > Chris Holy Toledo! That's a two-year-old bug spanning two versions of the langua= ge! BTW, Chris, the snippet I showed in the title essentially WAS the exact cod= e. 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 appl= ication is going to be distributed to a variety of computers at my workplac= e, 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, bec= ause it doesn't handle CSS and styles. My help page is the portal to a mul= ti-page users guide with a style sheet to render all the content consistent= ly. 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("fi= lepath") 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 shou= ld be only one obvious way to do things". If that one obvious way has a fa= tal bug, you're pretty much SOL.