Do not hide a failure to create a temporary file; if it fails the work
authorFred Drake <fdrake@acm.org>
Fri, 23 Feb 2001 20:04:54 +0000 (20:04 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 23 Feb 2001 20:04:54 +0000 (20:04 +0000)
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.

Lib/mimetools.py

index 81913bdf3d7c1898b8d1b2f7d3a05407b1725983..7cf8ad672e023c9ecfc057c23bcdaad826070b11 100644 (file)
@@ -204,11 +204,7 @@ def pipeto(input, command):
 
 def pipethrough(input, command, output):
     tempname = tempfile.mktemp()
-    try:
-        temp = open(tempname, 'w')
-    except IOError:
-        print '*** Cannot create temp file', `tempname`
-        return
+    temp = open(tempname, 'w')
     copyliteral(input, temp)
     temp.close()
     pipe = os.popen(command + ' <' + tempname, 'r')