[pypy-svn] r42198 - pypy/dist/pypy/module/_file/test

afa at codespeak.net afa at codespeak.net
Fri Apr 20 11:55:00 CEST 2007


Author: afa
Date: Fri Apr 20 11:54:59 2007
New Revision: 42198

Modified:
   pypy/dist/pypy/module/_file/test/test_file_extra.py
Log:
Open files in binary mode. Most tests pass on Windows


Modified: pypy/dist/pypy/module/_file/test/test_file_extra.py
==============================================================================
--- pypy/dist/pypy/module/_file/test/test_file_extra.py	(original)
+++ pypy/dist/pypy/module/_file/test/test_file_extra.py	Fri Apr 20 11:54:59 2007
@@ -248,7 +248,7 @@
     extra_args = ()
 
     def setup_method(self, method):
-        fd = os.open(TestFile.expected_filename, os.O_RDONLY)
+        fd = os.open(TestFile.expected_filename, os.O_RDONLY|os.O_BINARY)
         self.file = _file.file.fdopen(fd,
                                       self.expected_mode,
                                       *self.extra_args)
@@ -392,7 +392,7 @@
     assert os.stat(fn).st_size == 1
     f.close()
 
-    f = _file.file(fn, 'w', 1)
+    f = _file.file(fn, 'wb', 1)
     f.write('x')
     assert os.stat(fn).st_size == 0
     f.write('\n')
@@ -404,7 +404,7 @@
     f.close()
     assert os.stat(fn).st_size == 3
 
-    f = _file.file(fn, 'w', 100)
+    f = _file.file(fn, 'wb', 100)
     f.write('x')
     assert os.stat(fn).st_size == 0
     f.write('\n')



More information about the Pypy-commit mailing list