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

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Feb 24 15:50:02 EST 2013


On 24/02/2013 20:28, llanitedave wrote:
> On Sunday, February 24, 2013 1:35:31 AM UTC-8, Chris Rebert wrote:
>> On Feb 24, 2013 1:21 AM, "llanitedave" <llani... at veawb.coop> wrote:
>>
>>>
>>
>>> I created an html help page for my Python 2.7.3 application and put it in a documentation folder.  I used webbrowser.open() to fetch the page.
>>
>>>
>>
>>> On linux -- KDE specifically, the command opens the local file on my default browser with no issues.  However, on Windows 7, it opens Internet Explorer, which doesn't even search the local folder, but goes straight to the web and does a Google search, returning nothing but useless noise.
>>
>>
>>>
>>
>>> My default browser on Windows is Chrome, so my intention is getting undermined right from the start.
>>
>>>
>>
>>> How do I get a local html file to open properly from Python in Windows?
>>
>> 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:").
>>
>> Cheers,
>>
>> Chris
>
> Holy Toledo!  That's a two-year-old bug spanning two versions of the language!

Only two years is nothing.  Pay your money, take your choice :)

> 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.

Misquoted as always.  I guess that some day someone will quote it correctly.

-- 
Cheers.

Mark Lawrence




More information about the Python-list mailing list