[Python-checkins] r45864 - python/trunk/Lib/test/test_mailbox.py

guido.van.rossum python-checkins at python.org
Tue May 2 22:47:36 CEST 2006


Author: guido.van.rossum
Date: Tue May  2 22:47:36 2006
New Revision: 45864

Modified:
   python/trunk/Lib/test/test_mailbox.py
Log:
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing.  (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)


Modified: python/trunk/Lib/test/test_mailbox.py
==============================================================================
--- python/trunk/Lib/test/test_mailbox.py	(original)
+++ python/trunk/Lib/test/test_mailbox.py	Tue May  2 22:47:36 2006
@@ -577,14 +577,18 @@
         # Remove old files from 'tmp'
         foo_path = os.path.join(self._path, 'tmp', 'foo')
         bar_path = os.path.join(self._path, 'tmp', 'bar')
-        file(foo_path, 'w').close()
-        file(bar_path, 'w').close()
+        f = open(foo_path, 'w')
+        f.write("@")
+        f.close()
+        f = open(bar_path, 'w')
+        f.write("@")
+        f.close()
         self._box.clean()
         self.assert_(os.path.exists(foo_path))
         self.assert_(os.path.exists(bar_path))
         foo_stat = os.stat(foo_path)
-        os.utime(os.path.join(foo_path), (time.time() - 129600 - 2,
-                                          foo_stat.st_mtime))
+        os.utime(foo_path, (time.time() - 129600 - 2,
+                            foo_stat.st_mtime))
         self._box.clean()
         self.assert_(not os.path.exists(foo_path))
         self.assert_(os.path.exists(bar_path))


More information about the Python-checkins mailing list