Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7192] webbrowser.get("firefox") does not work on Mac with installed Firefox

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 23, 2009, 7:07 AM

Post #1 of 2 (116 views)
Permalink
[issue7192] webbrowser.get("firefox") does not work on Mac with installed Firefox

New submission from Andrew Dalke <dalke [at] dalkescientific>:

I have Firefox and Safari installed on my Mac. Safari is the default.

I wanted to try out Crunchy (http://code.google.com/p/crunchy/). It's
developed under Firefox and does not work under Safari. I tried. ;)

It starts the web browser with the following.

try:
client = webbrowser.get("firefox")
client.open(url)
return
except:
try:
client = webbrowser.get()
client.open(url)
return
except:
print('Please open %s in Firefox.' % url)

On my Mac, webbrowser.get("firefox") fails, so this ends up opening in
Safari. Which does not work to view the code.

Thing is, I have Firefox installed, so it should work. But the Mac code in
webbrowser appears to only open in the default browser.

The following bit of code works well enough to get crunchy to work

class MacOSXFirefox(BaseBrowser):
def open(self, url, new=0, autoraise=True):
subprocess.check_call(["/usr/bin/open", "-b",
"org.mozilla.firefox", url])

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

but I don't know enough about the Mac nor about webbrowser to know if I'm
the right path. For example, I don't know if there are ways to support
'new' and 'autoraise' through /usr/bin/open or if there's a better
solution.

Attached is the full diff.

----------
components: Library (Lib)
files: webbrowser.py.diff
keywords: patch
messages: 94387
nosy: dalke
severity: normal
status: open
title: webbrowser.get("firefox") does not work on Mac with installed Firefox
type: feature request
Added file: http://bugs.python.org/file15188/webbrowser.py.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7192>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 28, 2009, 2:16 AM

Post #2 of 2 (81 views)
Permalink
[issue7192] webbrowser.get("firefox") does not work on Mac with installed Firefox [In reply to]

Changes by Ned Deily <nad [at] acm>:


----------
assignee: -> ronaldoussoren
components: +Macintosh
nosy: +ronaldoussoren

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7192>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.