GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_webbrowser failing on MacOS · Issue #149496 · python/cpython

test_webbrowser failing on MacOS #149496

New issue
Copy link
New issue
Copy link
Closed
#149579
Closed
test_webbrowser failing on MacOS#149496
#149579
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@smontanaro
smontanaro
opened on May 7, 2026
Issue body actions

Bug report

Bug description:

After updating today, test_webbrowser is failing on my Mac (M1 MBP, up-to-date MacOS 26.4.1). Here's the failure in isolation:

% ./python.exe -m test -v test_webbrowser
== CPython 3.15.0a8+ free-threading build (heads/main:299cf3c4974, May 7 2026, 11:09:40) [Clang 22.1.4 ]
== macOS-26.4.1-arm64-arm-64bit-Mach-O little-endian
== Python build: free_threading release
== cwd: /Users/skip/src/python/cpython/build/test_python_worker_29041æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 2341159228
0:00:00 load avg: 2.05 Run 1 test sequentially in a single process
0:00:00 load avg: 2.05 [1/1] test_webbrowser
test_open (test.test_webbrowser.BackgroundBrowserCommandTest.test_open) ... ok
test_reject_dash_prefixes (test.test_webbrowser.BackgroundBrowserCommandTest.test_reject_dash_prefixes) ... ok
test_no_xdg_settings_on_macOS (test.test_webbrowser.BrowserRegistrationTest.test_no_xdg_settings_on_macOS) ... ok
test_register (test.test_webbrowser.BrowserRegistrationTest.test_register) ... ok
test_register_default (test.test_webbrowser.BrowserRegistrationTest.test_register_default) ... ok
test_register_preferred (test.test_webbrowser.BrowserRegistrationTest.test_register_preferred) ... ok
test_open (test.test_webbrowser.ChromeCommandTest.test_open) ... ok
test_open_bad_new_parameter (test.test_webbrowser.ChromeCommandTest.test_open_bad_new_parameter) ... ok
test_open_new (test.test_webbrowser.ChromeCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.ChromeCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.ChromeCommandTest.test_open_with_autoraise_false) ... ok
test_reject_action_dash_prefixes (test.test_webbrowser.ChromeCommandTest.test_reject_action_dash_prefixes) ... ok
test_reject_dash_prefixes (test.test_webbrowser.ChromeCommandTest.test_reject_dash_prefixes) ... ok
test_main (test.test_webbrowser.CliTest.test_main) ... ok
test_parse_args (test.test_webbrowser.CliTest.test_parse_args) ... ok
test_parse_args_error (test.test_webbrowser.CliTest.test_parse_args_error) ... ok
test_open (test.test_webbrowser.ELinksCommandTest.test_open) ... ok
test_open_new (test.test_webbrowser.ELinksCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.ELinksCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.ELinksCommandTest.test_open_with_autoraise_false) ... ok
test_reject_dash_prefixes (test.test_webbrowser.ELinksCommandTest.test_reject_dash_prefixes) ... ok
test_open (test.test_webbrowser.EdgeCommandTest.test_open) ... ok
test_open_new (test.test_webbrowser.EdgeCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.EdgeCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.EdgeCommandTest.test_open_with_autoraise_false) ... ok
test_reject_dash_prefixes (test.test_webbrowser.EdgeCommandTest.test_reject_dash_prefixes) ... ok
test_open (test.test_webbrowser.EpiphanyCommandTest.test_open) ... ok
test_open_new (test.test_webbrowser.EpiphanyCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.EpiphanyCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.EpiphanyCommandTest.test_open_with_autoraise_false) ... ok
test_reject_dash_prefixes (test.test_webbrowser.EpiphanyCommandTest.test_reject_dash_prefixes) ... ok
test_open (test.test_webbrowser.GenericBrowserCommandTest.test_open) ... ok
test_reject_dash_prefixes (test.test_webbrowser.GenericBrowserCommandTest.test_reject_dash_prefixes) ... ok
test_open (test.test_webbrowser.IOSBrowserTest.test_open) ... skipped 'Test only applicable to iOS'
test_open_new (test.test_webbrowser.IOSBrowserTest.test_open_new) ... skipped 'Test only applicable to iOS'
test_open_new_tab (test.test_webbrowser.IOSBrowserTest.test_open_new_tab) ... skipped 'Test only applicable to iOS'
test_open_with_autoraise_false (test.test_webbrowser.IOSBrowserTest.test_open_with_autoraise_false) ... skipped 'Test only applicable to iOS'
test_environment (test.test_webbrowser.ImportTest.test_environment) ... ok
test_environment_preferred (test.test_webbrowser.ImportTest.test_environment_preferred) ... ok
test_get (test.test_webbrowser.ImportTest.test_get) ... ok
test_register (test.test_webbrowser.ImportTest.test_register) ... ok
test_synthesize (test.test_webbrowser.ImportTest.test_synthesize) ... ok
test_default (test.test_webbrowser.MacOSTest.test_default) ... FAIL
test_default_http_open (test.test_webbrowser.MacOSTest.test_default_http_open) ... ok
test_default_non_http_uses_bundle_id (test.test_webbrowser.MacOSTest.test_default_non_http_uses_bundle_id) ... ok
test_named_known_browser_uses_bundle_id (test.test_webbrowser.MacOSTest.test_named_known_browser_uses_bundle_id) ... ok
test_named_unknown_browser_falls_back_to_dash_a (test.test_webbrowser.MacOSTest.test_named_unknown_browser_falls_back_to_dash_a) ... ok
test_open_failure (test.test_webbrowser.MacOSTest.test_open_failure) ... ok
test_deprecation_warning (test.test_webbrowser.MacOSXOSAScriptDeprecationTest.test_deprecation_warning) ... ok
test_default_browser_lookup (test.test_webbrowser.MacOSXOSAScriptTest.test_default_browser_lookup) ... ok
test_default_open (test.test_webbrowser.MacOSXOSAScriptTest.test_default_open) ... ok
test_explicit_browser (test.test_webbrowser.MacOSXOSAScriptTest.test_explicit_browser) ... ok
test_reject_dash_prefixes (test.test_webbrowser.MacOSXOSAScriptTest.test_reject_dash_prefixes) ... ok
test_url_quote (test.test_webbrowser.MacOSXOSAScriptTest.test_url_quote) ... ok
test_open (test.test_webbrowser.MozillaCommandTest.test_open) ... ok
test_open_new (test.test_webbrowser.MozillaCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.MozillaCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.MozillaCommandTest.test_open_with_autoraise_false) ... ok
test_reject_dash_prefixes (test.test_webbrowser.MozillaCommandTest.test_reject_dash_prefixes) ... ok
test_open (test.test_webbrowser.OperaCommandTest.test_open) ... ok
test_open_new (test.test_webbrowser.OperaCommandTest.test_open_new) ... ok
test_open_new_tab (test.test_webbrowser.OperaCommandTest.test_open_new_tab) ... ok
test_open_with_autoraise_false (test.test_webbrowser.OperaCommandTest.test_open_with_autoraise_false) ... ok
test_reject_dash_prefixes (test.test_webbrowser.OperaCommandTest.test_reject_dash_prefixes) ... ok

======================================================================
FAIL: test_default (test.test_webbrowser.MacOSTest.test_default)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/skip/src/python/cpython/Lib/test/test_webbrowser.py", line 345, in test_default
    self.assertIsInstance(browser, webbrowser.MacOS)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: <webbrowser.GenericBrowser object at 0x3e9fdbe80d0> is not an instance of <class 'webbrowser.MacOS'>

----------------------------------------------------------------------
Ran 64 tests in 0.028s

FAILED (failures=1, skipped=4)
test test_webbrowser failed
0:00:00 load avg: 2.05 [1/1/1] test_webbrowser failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_webbrowser

Total duration: 90 ms
Total tests: run=64 failures=1 skipped=4
Total test files: run=1/1 failed=1
Result: FAILURE

My BROWSER environment variable is set to open, pretty typical I would think for a Mac:

% env | grep BROWSER
BROWSER=open

Unsetting it allows the test to pass...

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

  • gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set #149579
  • [3.15] gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579) #149745

Activity

  1. smontanaro
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 7, 2026
  2. StanFromIreland
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    on May 7, 2026
  3. smontanaro commented on May 8, 2026

    @smontanaro
    smontanaro
    on May 8, 2026
    ContributorAuthor
    More actions

    @secengjeff seems to have committed the latest changes to webbrowser.

  4. secengjeff commented on May 8, 2026

    @secengjeff
    secengjeff
    on May 8, 2026
    Contributor
    More actions

    Thank you for raising this. I will dig in and report back.

  5. secengjeff commented on May 8, 2026

    @secengjeff
    secengjeff
    on May 8, 2026
    Contributor
    More actions

    This was a test regression that I introduced with the recent change to replace osascript with open. Fix: #149579

    FYI - @hugovk , @gpshead

  6. gpshead
    closed this as completedin #149579on May 8, 2026
  7. gpshead
    added a commit that references this issue on May 8, 2026

    gh-149496: Fix MacOSTest.test_default regression when BROWSER env var…

    45c47d2
  8. smontanaro commented on May 12, 2026

    @smontanaro
    smontanaro
    on May 12, 2026
    ContributorAuthor
    More actions

    @gpshead @hugovk I think the fix should be backported to 3.15. That doesn't appear to have happened. test_webbrowser passes for me on main, but not 3.15.

    Reacted by Hugo van Kemenade
  9. gpshead
    added
    needs backport to 3.15bugs and security fixesbugs and security fixes
    and removed
    needs backport to 3.15bugs and security fixesbugs and security fixes
    on May 12, 2026
  10. gpshead
    added a commit that references this issue on May 12, 2026

    [3.15] gh-149496: Fix MacOSTest.test_default regression when BROWSER …

    e3fbcc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.