summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-09-18 08:28:51 (GMT)
committerGitHub <noreply@github.com>2018-09-18 08:28:51 (GMT)
commit0185f34ddcf07b78feb6ac666fbfd4615d26b028 (patch)
treea27f02f0095d5a7fb1fcbd539114b3a74fb4fcc7 /Modules/clinic
parent7bdf28265aa371b39f82dfc6562635801aff15a5 (diff)
downloadcpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.zip
cpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.tar.gz
cpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.tar.bz2
bpo-33721: Make some os.path functions and pathlib.Path methods be tolerant to invalid paths. (#7695)
Such functions as os.path.exists(), os.path.lexists(), os.path.isdir(), os.path.isfile(), os.path.islink(), and os.path.ismount() now return False instead of raising ValueError or its subclasses UnicodeEncodeError and UnicodeDecodeError for paths that contain characters or bytes unrepresentative at the OS level.
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/posixmodule.c.h23
1 files changed, 1 insertions, 22 deletions
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index 2c46d4b..704c824 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -1005,27 +1005,6 @@ PyDoc_STRVAR(os__isdir__doc__,
#define OS__ISDIR_METHODDEF \
{"_isdir", (PyCFunction)os__isdir, METH_O, os__isdir__doc__},
-static PyObject *
-os__isdir_impl(PyObject *module, path_t *path);
-
-static PyObject *
-os__isdir(PyObject *module, PyObject *arg)
-{
- PyObject *return_value = NULL;
- path_t path = PATH_T_INITIALIZE("_isdir", "path", 0, 0);
-
- if (!PyArg_Parse(arg, "O&:_isdir", path_converter, &path)) {
- goto exit;
- }
- return_value = os__isdir_impl(module, &path);
-
-exit:
- /* Cleanup for path */
- path_cleanup(&path);
-
- return return_value;
-}
-
#endif /* defined(MS_WINDOWS) */
#if defined(MS_WINDOWS)
@@ -6778,4 +6757,4 @@ exit:
#ifndef OS_GETRANDOM_METHODDEF
#define OS_GETRANDOM_METHODDEF
#endif /* !defined(OS_GETRANDOM_METHODDEF) */
-/*[clinic end generated code: output=0f23518dd4482e66 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=40cac0135f846202 input=a9049054013a1b77]*/