[Python-checkins] CVS: python/dist/src/Lib mimetools.py,1.22,1.23

Fred L. Drake fdrake@users.sourceforge.net
Fri, 23 Feb 2001 12:04:56 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv17713

Modified Files:
	mimetools.py 
Log Message:

Do not hide a failure to create a temporary file; if it fails the work
will not have been done, and applications need to know that.  Also, do
not print a message about it; the exception is the right thing.

This closes SF bug #133717.


Index: mimetools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mimetools.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** mimetools.py	2001/01/25 15:29:22	1.22
--- mimetools.py	2001/02/23 20:04:54	1.23
***************
*** 205,213 ****
  def pipethrough(input, command, output):
      tempname = tempfile.mktemp()
!     try:
!         temp = open(tempname, 'w')
!     except IOError:
!         print '*** Cannot create temp file', `tempname`
!         return
      copyliteral(input, temp)
      temp.close()
--- 205,209 ----
  def pipethrough(input, command, output):
      tempname = tempfile.mktemp()
!     temp = open(tempname, 'w')
      copyliteral(input, temp)
      temp.close()