8000 gh-128540: lookup default webbrowser on macOS by minrk · Pull Request #130535 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128540: lookup default webbrowser on macOS #130535

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2025

Conversation

minrk
Copy link
Contributor
@minrk minrk commented Feb 25, 2025

ensures web browser is launched on mac, even for URLs that are not http[s]. Only does the lookup for non-http URLs, limiting the impact of the change.

I'm not sure what level of testing is appropriate, but I added some basic exercise for MacOSXOSAScript. The subprocess is mocked, so the correctness of the applescript still itself isn't tested at all.

Addresses gh-128540 on macOS only. I'll open separate PRs per platform, as recommended by @ned-deily.

More discussion in https://discuss.python.org/t/support-for-file-urls-in-webbrowser-open/81612

Backported implementation in https://pypi.org/project/webbrowser-open/

ensures web browser is launched on mac, even for URLs that are not http[s].
@minrk minrk force-pushed the default-browser-mac branch from 4daff9f to 26e799b Compare February 25, 2025 10:06
@hugovk hugovk changed the title gh-128540: lookup default webbrowser on mac gh-128540: lookup default webbrowser on macOS Feb 25, 2025
Copy link
Member
@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all of your work on this issue. I'm going to approve to merge this for the next 3.14 alpha. We should try to get the other PRs reviewed and merged soon.

@ned-deily ned-deily merged commit 9649278 into python:main Mar 14, 2025
43 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable 3.x (tier-2) has failed when building commit 9649278.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/125/builds/7186) and take a look at the build logs.
  4. Check if the failure is related to this commit (9649278) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/125/builds/7186

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/Lib/test/test_perf_profiler.py", line 362, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 713 events and lost 2[34 chars]\n\n' != ''
- Warning:
- Processed 713 events and lost 2 chunks!
- 
- Check IO/CPU overload!
- 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/Lib/test/test_perf_profiler.py", line 366, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::baz:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::baz:/tmp/test_python_x1qo3nl3/tmp0ewxo348/perftest.py' not found in 'python  393427 795965.336329:          1 cycles:Pu: \n\t    ffffa3595ac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  393427 795965.336354:          1 cycles:Pu: \n\t    ffffa3595ac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  393427 795965.337077:          1 cycles:Pu: \n\t    ffffa35875b0 <invalid>+0x650 (inlined)\n\t    ffffa35875b0 <invalid>+0x650 (inlined)\n\t    ffffa35875b0 _dl_relocate_object+0x650 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa359344f dl_main+0x164f (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa35905ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3591b17 _dl_start_final+0x5ab (inlined)\n\t    ffffa3591b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3595ad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  393427 795965.337097:        424 cycles:Pu: \n\t    ffffa35875ac <invalid>+0x64c (inlined)\n\t    ffffa35875ac <invalid>+0x64c (inlined)\n\t    ffffa35875ac _dl_relocate_object+0x64c (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa359344f dl_main+0x164f (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa35905ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3591b17 _dl_start_final+0x5ab (inlined)\n\t    ffffa3591b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3595ad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  393427 795965.338092:       1111 cycles:Pu: \n\t    ffffa3593450 dl_main+0x1650 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa35905ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3591b17 _dl_start_final+0x5ab (inlined)\n\t    ffffa3591b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3595ad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  393427 795965.338290:      63626 cycles:Pu: \n\t    ffffa357ef08 _dl_init+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffa3595af7 _dl_start_user+0x37 (inlined)\n\npython  393427 795965.339200:     136406 cycles:Pu: \n\t    ffffa2f29840 _PyInterpreterState_Main+0x0 (inlined)\n\t    ffffa2f29840 _Py_IsMainInterpreter+0x0 (inlined)\n\t    ffffa2f29840 _PyFloat_InitState+0x0 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so.1.0)\n\t    ffffa305d1bf pycore_init_global_objects+0x17 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so.1.0)\n\t    ffffa3200e8b pycore_interp_init+0x2b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so.1.0)\n\t    ffffa32059eb pyinit_config+0xaf (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so.1.0)\n\t    ffffa3217dab pyinit_core+0xdb (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so.1.0)\n\t    ffffa321858b Py_InitializeFromConfig+0x97 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/build_oot/libpython3.14d.so

plashchynski pushed a commit to plashchynski/cpython that referenced this pull request Mar 17, 2025
Ensure web browser is launched by `webbrowser.open` on macOS, even for `file://` URLs.
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Ensure web browser is launched by `webbrowser.open` on macOS, even for `file://` URLs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0