Re: [issue10799] Improve webbrowser.open doc (and, someday, behavior?)

2011-01-24 Thread Senthil Kumaran
On Wed, Jan 12, 2011 at 12:23:31AM +, Éric Araujo wrote:
> > I thought of adding 'http://' if not present but that would
> > disable opening files in a file browser.
> 
> I think that’s a Windows-specific behavior, not a promise of the
> *web*browser module.

If being lenient with URLs which do not start with http:// is the
idea, then webbrowser module can do explicitly add that. Having a
default protocol option in the open method and we can set it to
'http'.  Many WWW browsers do that.

But, I agree that it should not be related to Windows file-browser
behavior (for whatever it's behavior is). 

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10799] Improve webbrowser.open doc (and, someday, behavior?)

2011-01-11 Thread Éric Araujo

Éric Araujo  added the comment:

> I thought of adding 'http://' if not present but that would disable opening 
> files in a file browser.

I think that’s a Windows-specific behavior, not a promise of the *web*browser 
module.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10799] Improve webbrowser.open doc (and, someday, behavior?)

2010-12-30 Thread Terry J. Reedy

New submission from Terry J. Reedy :

webbrowser.open (and two aliases):

1. document return value, which seems to be: True if a browser tab or window is 
opened, regardless of whether or not the url is found; False otherwise.

2. document that (on Windows, at least) the default browser only gets used if a 
non .htm(l) url starts with 'www' or 'http:'.

This is true because os.startfile(url) apparently only works if above is true, 
as required for the Start/Run box to recognize an entry as a url.

In particular, I have Firefox as default and 'www.google.com' and 
'http://bugs.python.org' get opened in Firefox (new tab as requested). However, 
'google.com' and 'bugs.python.org' open with IE after some delay. [Start/run 
either opens with Firefox or reports 'cannot find'.]
-

In the longer run, what I would really like is for webbrowser to be better at 
using the default or finding executables.

I thought of adding 'http://' if not present but that would disable opening 
files in a file browser.

I suspect there is a registry entry but do not know what it is. That would also 
pick up new browswers like Chrome.

It seems to me that the current behavior is a 'limitation' in this code:

# Detect some common Windows browsers, fallback to IE
iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
"Internet Explorer\\IEXPLORE.EXE")
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
"netscape", "opera", iexplore):
if _iscommand(browser):
register(browser, None, BackgroundBrowser(browser))

Firefox is not being recognized as a command because _iscommand('firefox') does 
not not see firefox.exe as an executable because it only checks _isexecutable() 
in the hodgepodge list of paths in PATH. At one time (but no longer), 
executables were ofter put in c:/windows, which by default is in PATH.

Since you hardcoded the default real path for iexplore (C:\\Program 
Files\\"Internet Explorer\\IEXPLORE.EXE"), you could do the same for other 
programs: 

firefox = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), 
"Mozilla Firefox\\firefox.exe")

--
assignee: georg.brandl
components: Library (Lib)
messages: 124949
nosy: georg.brandl, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Improve webbrowser.open doc (and, someday, behavior?)
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com