Index: twisted/mail/test/test_mail.py
===================================================================
--- twisted/mail/test/test_mail.py	(revision 35845)
+++ twisted/mail/test/test_mail.py	(working copy)
@@ -199,7 +199,7 @@
         for line in contents.splitlines():
             self.fp.lineReceived(line)
         self.fp.eomReceived()
-        self.assertEqual(file(self.final).read(), contents)
+        self.assertEqual(FilePath(self.final).open().read(), contents)
 
     def test_interrupted(self):
         contents = "first line\nsecond line\n"
@@ -863,7 +863,7 @@
         self.messageFiles = []
         for i in range(10):
             name = self.tmpdir.child('body-%d' % (i,)).path
-            with FilePath(name + '-H').open('wb') as f:
+            with FilePath(name + '-H').open('w') as f:
                 pickle.dump(['from-%d' % (i,), 'to-%d' % (i,)], f)
 
             f = FilePath(name + '-D').open('w')
