[Python-checkins] CVS: python/dist/src/Lib webbrowser.py,1.2,1.3

Tim Peters python-dev@python.org
Fri, 22 Sep 2000 03:05:57 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv17199/python/dist/src/Lib

Modified Files:
	webbrowser.py 
Log Message:
Implemented new os.startfile function, unique to Windows, exposing a
subset of Win32 ShellExecute's functionality.  Guido wants this because
IDLE's Help -> Docs function currently crashes his machine because of a
conflict between his version of Norton AntiVirus (6.10.20) and MS's
_popen.  Docs for startfile are being mailed to Fred (or just read the
docstring -- it tells the whole story).
Changed webbrowser.py to use os.startfile instead of os.popen on Windows.
Changed IDLE's EditorWindow.py to pass an absolute path for the docs
(hardcoding ShellExecute's "directory" arg to "." as used to be done let
IDLE work, but made the startfile command exceedingly obscure for other
uses -- the MS docs are terrible, of course, & still not sure I
understand it).
Note that Windows Python must link with shell32.lib now!  That's where
ShellExecute lives.


Index: webbrowser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** webbrowser.py	2000/09/03 17:12:50	1.2
--- webbrowser.py	2000/09/22 10:05:52	1.3
***************
*** 184,188 ****
  class WindowsDefault:
      def open(self, url, new=0):
!         self.junk = os.popen("start " + url)
  
      def open_new(self, url):
--- 184,188 ----
  class WindowsDefault:
      def open(self, url, new=0):
!         os.startfile(url)
  
      def open_new(self, url):