diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-24 12:16:28 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-24 12:16:28 +0100 |
commit | 7f8ff41ec0ff818773f2fa5d01c21dc5cdb9d19a (patch) | |
tree | 238877d9dd4e8462a9736d6d9ef33e187cd655c9 /Python | |
parent | 32f51cebfbd544a02c3dcde1ebc746559148f9a0 (diff) | |
download | cpython-7f8ff41ec0ff818773f2fa5d01c21dc5cdb9d19a.tar.gz |
Issue #23753: Move _Py_wstat() from Python/fileutils.c to Modules/getpath.c
I expected more users of _Py_wstat(), but in practice it's only used by
Modules/getpath.c. Move the function because it's not needed on Windows.
Windows uses PC/getpathp.c which uses the Win32 API (ex: GetFileAttributesW())
not the POSIX API.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/fileutils.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c index 63c2571492..e6d3154490 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -520,23 +520,6 @@ Py_EncodeLocale(const wchar_t *text, size_t *error_pos) } -/* Get file status. Encode the path to the locale encoding. */ -int -_Py_wstat(const wchar_t* path, struct stat *buf) -{ - int err; - char *fname; - fname = Py_EncodeLocale(path, NULL); - if (fname == NULL) { - errno = EINVAL; - return -1; - } - err = stat(fname, buf); - PyMem_Free(fname); - return err; -} - - #ifdef MS_WINDOWS static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 and 1.1.1970 */ |