This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregcouch
Recipients
Date 2005-12-06.20:21:06
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=131838

Oops, that was bug #1352621 for an analysis of why the
previous fix was bad.  I closed it as a duplicate because
this bug was reopened.

The short answer to your question about schemeless URLs, is
no, they aren't supposed to work because they are not URLs.
 Whether or not webbrowser.open should support filesystem
paths in addition to URLs, is a different
bug/question/patch.  In my application, I encapsulate
webbrowser.open with code that supports it and it could be
added fairly easily.  Here's the information needed for
anyone to do so:

Whether:

    webbrowser.open("/tmp/mmhelp.html")

works or not is browser dependent (works with Netscape
4.76!).  In fact, even the other example:

     webbrowser.open("file:///tmp/mmhelp.html")

will fail on some browsers (Safari, may be fixed by now),
and one needs to do:

     webbrowser.open("file://localhost/tmp/mmhelp.html")

instead (so a bug, but one my application had to
workaround).  I recall there being cases of the reverse
being true, but I can't find those notes.

Constructing the file URL is a minor pain, but I'm not sure
what I'd change.  I use urllib.pathname2url(), but that
doesn't add the file scheme.  So I use urlparse.urlunparse
to build the actual URL -- that seems like overkill, but I
might have a fragment (some browsers support fragments with
the file scheme, some just ignore them).  The OS X bug is
easy fix in between the calls to pathname2url and urlunparse.
History
Date User Action Args
2007-08-23 14:35:48adminlinkissue1338995 messages
2007-08-23 14:35:48admincreate