[Nym3-commit] r195 - trunk/nym3
laurent at conuropsis.org
laurent at conuropsis.org
Mon Apr 11 22:35:52 CEST 2005
Author: laurent
Date: 2005-04-11 22:35:51 +0200 (Mon, 11 Apr 2005)
New Revision: 195
Modified:
trunk/nym3/Mail.py
Log:
Rewrite secure temporary file stuff
Modified: trunk/nym3/Mail.py
===================================================================
--- trunk/nym3/Mail.py 2005-04-11 20:35:48 UTC (rev 194)
+++ trunk/nym3/Mail.py 2005-04-11 20:35:51 UTC (rev 195)
@@ -66,19 +66,14 @@
return res + 'X-Octets: ' + repr(len(msg)) + "\n" + body
-def myWrite(f, m):
- """Safe write : Writes all the bytes of m in the file f"""
- def aux(m, l):
- w = os.write(f,m)
- aux(m[w:], l-w)
- aux(m, len(m))
-
def tmpFileMsg(body):
"""write body in a temp file name and return a file name of this file
"""
(fd, fname) = tempfile.mkstemp()
- myWrite(f,body)
os.close(fd)
+ f = open("fname", "w")
+ f.write(body)
+ f.close()
return fname
More information about the Nym3-commit
mailing list