Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: webbrowser.open always opens up Safari on Lion

Reply
Thread Tools

Re: webbrowser.open always opens up Safari on Lion

 
 
Steven D'Aprano
Guest
Posts: n/a
 
      02-26-2012
On Sun, 26 Feb 2012 09:33:15 +0800, Leo wrote:

> Hello,
>
> On Lion and with its stock python version 2.7.1 r271:86832,
> webbrowser.open('file://localhost/nonexistingfile') always opens up
> Safari. Is this a bug?


What part of this do you think is the bug, and why? What part of the
behaviour actually experienced contradicts the documented behaviour of
webbrowser.open()?

http://docs.python.org/library/webbrowser.html

--
Steven
 
Reply With Quote
 
 
 
 
Leo
Guest
Posts: n/a
 
      02-26-2012
On 2012-02-26 11:36 +0800, Steven D'Aprano wrote:
> What part of this do you think is the bug, and why? What part of the
> behaviour actually experienced contradicts the documented behaviour of
> webbrowser.open()?
>
> http://docs.python.org/library/webbrowser.html


If you have the default browser set to Chrome, it still opens up Safari.

Leo
 
Reply With Quote
 
 
 
 
Cameron Simpson
Guest
Posts: n/a
 
      02-26-2012
On 26Feb2012 14:23, Leo <(E-Mail Removed)> wrote:
| On 2012-02-26 11:36 +0800, Steven D'Aprano wrote:
| > What part of this do you think is the bug, and why? What part of the
| > behaviour actually experienced contradicts the documented behaviour of
| > webbrowser.open()?
| >
| > http://docs.python.org/library/webbrowser.html
|
| If you have the default browser set to Chrome, it still opens up Safari.

On the suppostion that "the default browser" is actually multiple
settings, one for each of several URL (URI?) schemes, what do these two
shell commands do for you? From a shell prompt in a Terminal:

open file://localhost/nonexistingfile
and
open http://www.python.org/

Do they both open Chome for you?
--
Cameron Simpson <(E-Mail Removed)> DoD#743
http://www.cskk.ezoshosting.com/cs/

DRM doesn't inconvenience pirates ¿ indeed, over time it trains
law-abiding users to become pirates out of sheer frustration.
- Charles Stross
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      02-26-2012
On Sun, 26 Feb 2012 14:23:43 +0800, Leo wrote:

> On 2012-02-26 11:36 +0800, Steven D'Aprano wrote:
>> What part of this do you think is the bug, and why? What part of the
>> behaviour actually experienced contradicts the documented behaviour of
>> webbrowser.open()?
>>
>> http://docs.python.org/library/webbrowser.html

>
> If you have the default browser set to Chrome, it still opens up Safari.



That would only be a bug if it occurs with http:// URLs. The
documentation clearly says:

Note that on some platforms, trying to open a filename using
this function, may work and start the operating system’s associated
program. However, this is neither supported nor portable.


Since you are providing a file:// URL, then the behaviour is unspecified,
and no, it is not a bug. Arguably it is a bug that file:// URLs work at
all.

However, I would guess that if you have a patch to fix this behaviour to
something more reasonable (but what?) then it might be approved.

Feel free to raise a ticket on the bug tracker. Personally, I'd put it
down as a feature request rather than a bug.



--
Steven
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Question: Why is it that Windows Explorer (WinXP Pro SP3) always opens at My Documents, regardless of what you have it set to Start In Bert Hyman Computer Support 0 07-31-2010 03:23 PM
Windows explorer always opens at Documents =?Utf-8?B?cGFjcw==?= Windows 64bit 2 10-16-2007 12:37 AM
IE Window Always Opens Minimized =?Utf-8?B?TXJNaWtl?= ASP .Net 4 05-27-2005 02:28 PM
MS Excel always opens 2 unwanted docs gigajosh Computer Support 2 01-09-2004 11:19 PM
os.system always opens new window on Windows XP/2000 John Python 5 01-09-2004 12:03 PM



Advertisments