[pypy-svn] r73876 - in pypy/trunk/pypy/module/posix: . test

agaynor at codespeak.net agaynor at codespeak.net
Sun Apr 18 21:33:15 CEST 2010


Author: agaynor
Date: Sun Apr 18 21:33:12 2010
New Revision: 73876

Modified:
   pypy/trunk/pypy/module/posix/interp_posix.py
   pypy/trunk/pypy/module/posix/test/test_posix2.py
Log:
os.open should use the file system encoding.

Modified: pypy/trunk/pypy/module/posix/interp_posix.py
==============================================================================
--- pypy/trunk/pypy/module/posix/interp_posix.py	(original)
+++ pypy/trunk/pypy/module/posix/interp_posix.py	Sun Apr 18 21:33:12 2010
@@ -20,7 +20,7 @@
     except OSError, e: 
         raise wrap_oserror(space, e, fname)
     return space.wrap(fd)
-open.unwrap_spec = [ObjSpace, str, "c_int", "c_int"]
+open.unwrap_spec = [ObjSpace, 'path', "c_int", "c_int"]
 
 def lseek(space, fd, pos, how):
     """Set the current position of a file descriptor.  Return the new position.

Modified: pypy/trunk/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/trunk/pypy/module/posix/test/test_posix2.py	(original)
+++ pypy/trunk/pypy/module/posix/test/test_posix2.py	Sun Apr 18 21:33:12 2010
@@ -659,6 +659,13 @@
             self.posix.stat(u"ą")
         except OSError:
             pass
+    
+    def test_open_unicode(self):
+        # Ensure passing unicode doesn't raise UnicodeEncodeError
+        try:
+            self.posix.open(u"ą", self.posix.O_WRONLY)
+        except OSError:
+            pass
 
 
 class TestPexpect(object):



More information about the Pypy-commit mailing list