Re: webbrowser.open always opens up Safari on Lion

Discussion in 'Python' started by Steven D'Aprano, Feb 26, 2012.

  1. 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
    Steven D'Aprano, Feb 26, 2012
    #1
    1. Advertising

  2. Steven D'Aprano

    Leo Guest

    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
    Leo, Feb 26, 2012
    #2
    1. Advertising

  3. On 26Feb2012 14:23, 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.

    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 <> 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
    Cameron Simpson, Feb 26, 2012
    #3
  4. 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
    Steven D'Aprano, Feb 26, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TXJNaWtl?=

    IE Window Always Opens Minimized

    =?Utf-8?B?TXJNaWtl?=, May 26, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    6,905
    =?Utf-8?B?TXJNaWtl?=
    May 27, 2005
  2. John
    Replies:
    5
    Views:
    429
    Dang Griffith
    Jan 9, 2004
  3. Timur Tabi
    Replies:
    4
    Views:
    2,778
    Timur Tabi
    Jan 18, 2010
  4. Mitchell L Model
    Replies:
    1
    Views:
    488
    Paul Boddie
    Jan 27, 2010
  5. davb

    ModalPopupExtender opens on Safari

    davb, Sep 9, 2013, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    800
Loading...

Share This Page