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

fijal at codespeak.net fijal at codespeak.net
Sat Apr 17 20:16:11 CEST 2010


Author: fijal
Date: Sat Apr 17 20:16:10 2010
New Revision: 73831

Modified:
   pypy/trunk/pypy/module/posix/interp_posix.py
   pypy/trunk/pypy/module/posix/test/test_posix2.py
Log:
use 'path' for stat and lstat


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	Sat Apr 17 20:16:10 2010
@@ -180,7 +180,7 @@
         raise wrap_oserror(space, e, path)
     else: 
         return build_stat_result(space, st)
-stat.unwrap_spec = [ObjSpace, str]
+stat.unwrap_spec = [ObjSpace, 'path']
 
 def lstat(space, path):
     "Like stat(path), but do no follow symbolic links."
@@ -190,7 +190,7 @@
         raise wrap_oserror(space, e, path)
     else:
         return build_stat_result(space, st)
-lstat.unwrap_spec = [ObjSpace, str]
+lstat.unwrap_spec = [ObjSpace, 'path']
 
 class StatState(object):
     def __init__(self, space):

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	Sat Apr 17 20:16:10 2010
@@ -1,3 +1,6 @@
+
+# -*- coding: utf-8 -*-
+
 from pypy.objspace.std import StdObjSpace 
 from pypy.tool.udir import udir
 from pypy.conftest import gettestobjspace
@@ -140,6 +143,13 @@
         st = self.posix.lstat(".")
         assert stat.S_ISDIR(st.st_mode)
 
+    def test_stat_unicode(self):
+        # test that passing unicode would not raise UnicodeDecodeError
+        try:
+            self.posix.stat(u"ą")
+        except OSError:
+            pass
+
     def test_stat_exception(self):
         import sys, errno
         for fn in [self.posix.stat, self.posix.lstat]:



More information about the Pypy-commit mailing list