Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'essentially': 0.04; 'mrab': 0.05; 'paths': 0.05; 'problem:': 0.07; 'subject:Windows': 0.09; 'python': 0.09; 'argument,': 0.09; 'path.': 0.09; 'snippet': 0.09; 'to:addr:comp.lang.python': 0.09; 'bug': 0.10; 'cc:addr :python-list': 0.10; 'yet.': 0.13; '24,': 0.16; 'bug,': 0.16; 'chris,': 0.16; 'downside': 0.16; 'fatal': 0.16; 'folder.': 0.16; 'guess.': 0.16; 'holy': 0.16; 'ie.': 0.16; 'illustrates': 0.16; 'least,': 0.16; 'menu.': 0.16; 'pathname': 0.16; 'plus,': 0.16; 'substitute': 0.16; 'variable.': 0.16; 'wxpython': 0.16; 'wrote:': 0.17; 'fix': 0.17; '(in': 0.18; '(or': 0.18; 'code.': 0.20; 'versions': 0.20; 'trying': 0.21; 'browsers': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; 'absolute': 0.23; "i've": 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'feature': 0.24; 'url:bugs': 0.24; 'linux': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'guess': 0.27; 'css': 0.27; 'subject:skip:d 10': 0.27; "doesn't": 0.28; 'subject:/': 0.28; 'chris': 0.28; 'environment': 0.29; 'link,': 0.29; 'case,': 0.29; "i'm": 0.29; 'relative': 0.30; 'function': 0.30; 'url:python': 0.32; 'not.': 0.32; 'goes': 0.33; "aren't": 0.33; 'handle': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'path': 0.35; 'open': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'really': 0.36; 'but': 0.36; 'url:org': 0.36; 'method': 0.36; 'should': 0.36; 'does': 0.37; 'two': 0.37; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'brief': 0.38; 'there,': 0.38; 'page': 0.38; 'called': 0.39; 'list,': 0.39; 'application': 0.40; 'help': 0.40; 'your': 0.60; 'gave': 0.65; 'computers': 0.69; 'internet': 0.71; 'obvious': 0.71; 'sounds': 0.71; 'assurance': 0.74; 'click': 0.76; '2013': 0.84; 'browsers,': 0.84; 'language!': 0.84; 'suspecting': 0.84; 'pc.': 0.93; 'sheet': 0.93 X-Received: by 10.49.35.77 with SMTP id f13mr688701qej.4.1361754204748; Sun, 24 Feb 2013 17:03:24 -0800 (PST) Newsgroups: comp.lang.python Date: Sun, 24 Feb 2013 17:03:24 -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 References: <659b4770-12fb-400f-8aa5-049605347fe2@googlegroups.com> <5fbb36fe-a2b3-4ea6-a42e-53d46845865e@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 66.162.99.34 MIME-Version: 1.0 Subject: Re: webbrowser.open("./documentation/help.html")-- No Go in Windows From: llanitedave To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 90 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361759307 news.xs4all.nl 6843 [2001:888:2000:d::a6]:34342 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39865 On Sunday, February 24, 2013 2:15:10 PM UTC-8, MRAB wrote: > On 2013-02-24 20:28, llanitedave wrote: >=20 > > On Sunday, February 24, 2013 1:35:31 AM UTC-8, Chris Rebert wrote: >=20 > [snip] >=20 > >> Sounds like this might be your problem: >=20 > >> >=20 > >> http://bugs.python.org/issue8936 >=20 > >> >=20 > >> The fix would seem to be ensuring that the URL you pass includes >=20 > >> the scheme (in your case, "file:"). >=20 > >> >=20 > > Holy Toledo! That's a two-year-old bug spanning two versions of the >=20 > > language! >=20 > > >=20 > > BTW, Chris, the snippet I showed in the title essentially WAS the >=20 > > exact code. It's a method with that single line called from a >=20 > > wxPython Help menu. I can't really put an absolute pathname into the >=20 > > argument, because the application is going to be distributed to a >=20 > > variety of computers at my workplace, and there's no assurance that >=20 > > it will go into (or remain in)a particular folder. >=20 > > >=20 > > I was trying to avoid using the wx.html.HtmlWindow feature of >=20 > > wxPython, because it doesn't handle CSS and styles. My help page is >=20 > > the portal to a multi-page users guide with a style sheet to render >=20 > > all the content consistently. >=20 > > >=20 > > Plus, I couldn't get the wx.html.HtmlWindow to open relative paths >=20 > > either -- it gave me "URL Malformed" messages even in KDE, when >=20 > > webbrowser.open("filepath") was working for the exact same path. But >=20 > > that's something to take up on the wxPython list, I guess. >=20 > > >=20 > > This to me illustrates the downside of the Python philosophy of >=20 > > "There should be only one obvious way to do things". If that one >=20 > > obvious way has a fatal bug, you're pretty much SOL. >=20 > > >=20 > I've had a brief look at webbrowser.py. It's looking for the browsers in= =20 >=20 > the paths listed in the PATH environment variable. >=20 >=20 >=20 > On my PC at least, the paths to the other browsers, such as "C:\Program >=20 > Files\Mozilla Firefox" for Firefox, aren't listed there, hence the only >=20 > 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 m= y PC. It's just using the webbrowser.open() function that goes to IE. Unt= il then, I'd been suspecting that wx.html.HtmlWindow was using webbrowser.o= pen() 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.