mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Convert file names of posix.access according to the file system encoding.
This commit is contained in:
parent
3e1dd3be49
commit
b60ae99601
3 changed files with 6 additions and 1 deletions
|
@ -44,8 +44,10 @@ class TestUnicodeFiles(unittest.TestCase):
|
||||||
def _do_single(self, filename):
|
def _do_single(self, filename):
|
||||||
self.failUnless(os.path.exists(filename))
|
self.failUnless(os.path.exists(filename))
|
||||||
self.failUnless(os.path.isfile(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.exists(os.path.abspath(filename)))
|
||||||
self.failUnless(os.path.isfile(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.chmod(filename, 0777)
|
||||||
os.utime(filename, None)
|
os.utime(filename, None)
|
||||||
os.utime(filename, (time.time(), time.time()))
|
os.utime(filename, (time.time(), time.time()))
|
||||||
|
|
|
@ -47,6 +47,8 @@ Core and builtins
|
||||||
Extension Modules
|
Extension Modules
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- os.access now supports Unicode path names on non-Win32 systems.
|
||||||
|
|
||||||
- Patches #925152, #1118602: Avoid reading after the end of the buffer
|
- Patches #925152, #1118602: Avoid reading after the end of the buffer
|
||||||
in pyexpat.GetInputContext.
|
in pyexpat.GetInputContext.
|
||||||
|
|
||||||
|
|
|
@ -1113,7 +1113,8 @@ posix_access(PyObject *self, PyObject *args)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!PyArg_ParseTuple(args, "si:access", &path, &mode))
|
if (!PyArg_ParseTuple(args, "eti:access",
|
||||||
|
Py_FileSystemDefaultEncoding, &path, &mode))
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
res = access(path, mode);
|
res = access(path, mode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue