Commits

Martin von Löwis committed 5180cfc

Backport of change to os.access to encode Unicode file names with
the file system encoding.

  • Participants
  • Parent commits 6f9b36f
  • Branches 2.4

Comments (0)

Files changed (3)

File Lib/test/test_unicode_file.py

     def _do_single(self, filename):
         self.failUnless(os.path.exists(filename))
         self.failUnless(os.path.isfile(filename))
+        self.failUnless(os.access(filename, os.R_OK))
         self.failUnless(os.path.exists(os.path.abspath(filename)))
         self.failUnless(os.path.isfile(os.path.abspath(filename)))
+        self.failUnless(os.access(os.path.abspath(filename), os.R_OK))
         os.chmod(filename, 0777)
         os.utime(filename, None)
         os.utime(filename, (time.time(), time.time()))
   name returned by socket.gethostname() a valid return value for getfqdn().
   Also clarified the wording of docs and docstring that this is the case.
 
+Extensions Modules
+------------------
+
+- os.access now supports Unicode path names on non-Win32 systems.
+
 
 What's New in Python 2.4.1c1?
 =============================

File Modules/posixmodule.c

 		PyErr_Clear();
 	}
 #endif
-	if (!PyArg_ParseTuple(args, "si:access", &path, &mode))
+	if (!PyArg_ParseTuple(args, "eti:access", 
+			      Py_FileSystemDefaultEncoding, &path, &mode))
 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
 	res = access(path, mode);