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 zmwangx
Recipients zmwangx
Date 2018-11-24.15:26:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za>
In-reply-to
Content
This is a regression in Python 3.7:

    $ BROWSER=w3m python3.6 -c 'import sys; import webbrowser; print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)'
    3.6.7 (default, Nov 24 2018, 09:47:01)
    [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]
    <webbrowser.GenericBrowser object at 0x1066207f0>
    ['w3m', 'MacOSX', 'chrome', 'firefox', 'safari', 'w3m']

    $ BROWSER=w3m python3.7 -c 'import sys; import webbrowser; print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)'
    3.7.1 (default, Nov 24 2018, 09:35:18)
    [Clang 10.0.0 (clang-1000.11.45.5)]
    <webbrowser.MacOSXOSAScript object at 0x1061fe828>
    ['MacOSX', 'chrome', 'firefox', 'safari', 'w3m', 'w3m']

Note how Python 3.7.1 webbrowser decides to choose MacOSX as the default although BROWSER is explicitly set to w3m. (The above code does not run on Python 3.7.0 due to bpo-31014).

This is because of misinterpretation of the `preferred` kwarg when bpo-31014 was fixed. See https://github.com/python/cpython/commit/25b804a9c21c735ce322877f105ebab2539ccfc1#diff-546766353a40839aa72374ecca5b0925R566. Browsers in BROWSER should be registered as `preferred=True` instead.
History
Date User Action Args
2018-11-24 15:26:41zmwangxsetrecipients: + zmwangx
2018-11-24 15:26:41zmwangxsetmessageid: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za>
2018-11-24 15:26:41zmwangxlinkissue35308 messages
2018-11-24 15:26:41zmwangxcreate