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 michael-lazar
Recipients michael-lazar
Date 2017-09-05.02:34:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504578897.75.0.995498042224.issue31348@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

I have found that [1] is an open issue, but I have discovered what appears to be a completely separate bug than the one described in that ticket. The issue is that there is no way to specify a MacOSXOSAScript browser using the BROWSER variable. The _synthesize() command fails at the "if not shutil.which(cmd)" line, because OSAScript browsers are not commands in the system path. As a result, the value specified by BROWSER will get re-mapped to a GenericBrowser type, which is useless for most people on macOS.

Here's an example:

$ BROWSER=firefox python3
Python 3.6.1 (default, Apr  4 2017, 09:36:47)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> for name in webbrowser._tryorder:
...     print('%s: %s' % (name, webbrowser._browsers[name.lower()]))
...
firefox: [None, <webbrowser.GenericBrowser object at 0x100f35198>]
MacOSX: [None, <webbrowser.MacOSXOSAScript object at 0x100f35748>]
chrome: [None, <webbrowser.MacOSXOSAScript object at 0x100f76f28>]
firefox: [None, <webbrowser.GenericBrowser object at 0x100f35198>]
safari: [None, <webbrowser.MacOSXOSAScript object at 0x100f76ef0>]
links: [None, <webbrowser.GenericBrowser object at 0x100e67b70>]
elinks: [None, <webbrowser.Elinks object at 0x100f17fd0>]
lynx: [None, <webbrowser.GenericBrowser object at 0x100f76048>]
w3m: [None, <webbrowser.GenericBrowser object at 0x100f76588>]

Note that on macOS, firefox is defined in the webbrowser module as

    register("firefox", None, MacOSXOSAScript('firefox'), -1)


[1] http://bugs.python.org/issue24955
History
Date User Action Args
2017-09-05 02:34:57michael-lazarsetrecipients: + michael-lazar
2017-09-05 02:34:57michael-lazarsetmessageid: <1504578897.75.0.995498042224.issue31348@psf.upfronthosting.co.za>
2017-09-05 02:34:57michael-lazarlinkissue31348 messages
2017-09-05 02:34:56michael-lazarcreate