webbrowser open failing

John McMonagle jmcmonagle at velseis.com.au
Wed Jul 26 02:39:03 EDT 2006


On Wed, 2006-07-26 at 17:09 +1200, Thomas wrote:
> Hi all,
> 
> I am getting an error using webbrowser open on mac 10.3 using python  
> 2.3.5
> 
>  >>> test=open("/Volumes/TINTZ;P3/DT Hot Folder  
> test/Justin_Test.pDF","r")
>  >>> type(test)
> <type 'file'>
>  >>> webbrowser.open("/Volumes/TINTZ;P3/DT Hot Folder  
> test/Justin_Test.pDF","r")
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File  
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/webbrowser.py", line 43, in open
>      get().open(url, new, autoraise)
>    File  
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/webbrowser.py", line 314, in open
>      ic.launchurl(url)
>    File  
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/plat-mac/ic.py", line 235, in launchurl
>      return _dft_ic.launchurl(url, hint)
>    File  
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/plat-mac/ic.py", line 202, in launchurl
>      self.ic.ICLaunchURL(hint, url, 0, len(url))
> MacOS.Error: (-673, 'no URL found')

Try opening a file-type URL:

eg:
webbrowser.open("file://Volumes/TINTZ;P3/DT....")

No need for the 'r' argument to open.

Syntax is:

 webbrowser.open(url [, new])

If new is True a new browser window is opened.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Python-list mailing list