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.

classification
Title: Fix webbrowser running on MachoPython
Type: Stage:
Components: macOS Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen, sburrious
Priority: normal Keywords: patch

Created on 2002-01-11 06:26 by sburrious, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
webbrowser.diff sburrious, 2002-01-11 06:26 patch to version 1.27 of webbrowser.py
webbrowser2.diff sburrious, 2002-01-14 03:50 Replacement patch to v. 1.27 of webbrowser.py
Messages (4)
msg38686 - (view) Author: Steven J. Burr (sburrious) Date: 2002-01-11 06:26
Allows webbrowser.open call in the Unix version of python running on Mac OS X to open a url in Internet Explorer.  Presently, a call to webbrowser.open on this platform either runs a terminal-based browser, such as lynx, if available, or fails.

The patch is a context diff against version 1.27 of webbrowser, which appears to be the latest version in CVS.  It adds a MacOSX browser class and a test for Mac OS X systems running the Unix version of python.  I have tested it successfully several times on my Mac OS X system.

I included:

    assert url not in "'"

from the 1.27 version in the MacOSX open method, even though the method calls os.popen rather than os.system to launch the browser.  It seemed likely os.popen would raise similar security concerns.
msg38687 - (view) Author: Steven J. Burr (sburrious) Date: 2002-01-14 03:50
Logged In: YES 
user_id=322368

I have submitted a new patch which adds the following functionality:
-Uses default browser selected in System Preferences if no browser specified.
-Allows user to choose any of the following installed browsers:  OmniWeb, iCab, Netscape, Opera, Internet Explorer, links, lynx, w3m.
-Tests for OS X running without window server as well as Darwin without OS X.  (Note that even without this test, use of the module without the window server did not crash Python, but instead generated the following error message:  "KCGErrorFailure:  initCGDisplayState: No display interlock.")
-Opens url in new window with open_new function or method, if the browser supports this behavior.
-Adds support for the Unix Dillo browser.
msg38688 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-02-05 23:07
Logged In: YES 
user_id=45365

Steven,
there's a few problems with your patch that I'd like you to fix before I check it in (or convince me:-):
- There's references to dillo that seem unrelated, could you take them out?
- I'm not sure your code correctly handles the case of the Internet Config module being available on OSX. Does it?
- The trick with running ps to see whether the finder is there is only half a solution (the finder may be running but you may still not have access to the window manager, for instance when you're ssh'd to someone else's machine) and it's expensive and error prone too. How about trying to send a noop appleevent to the finder and seeing whether that works?
- You can probably get rid of the KCGErrorFailure messages by adding a 2>/dev/null the the applescript command.
msg38689 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-05-23 22:24
Logged In: YES 
user_id=45365

Steven,
I asked for clarification on various things in your patch on Feb 6, but you haven't replied yet, and I don't want to accept the patch as-is. I've set the state of the patch to "pending", so you now have 14 days to reply if you feel like doing so (otherwise sourceforge will close the patch).
History
Date User Action Args
2022-04-10 16:04:52adminsetgithub: 35904
2002-01-11 06:26:39sburriouscreate