From 9dd762013fd9fcf975ad51700b55d050ca9ed60e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 21 Dec 2017 16:20:32 +0100 Subject: bpo-32030: Add _Py_EncodeLocaleRaw() (#4961) Replace Py_EncodeLocale() with _Py_EncodeLocaleRaw() in: * _Py_wfopen() * _Py_wreadlink() * _Py_wrealpath() * _Py_wstat() * pymain_open_filename() These functions are called early during Python intialization, only the RAW memory allocator must be used. --- Modules/getpath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/getpath.c') diff --git a/Modules/getpath.c b/Modules/getpath.c index b4b33437b6..494fa19bdf 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -140,13 +140,13 @@ _Py_wstat(const wchar_t* path, struct stat *buf) { int err; char *fname; - fname = Py_EncodeLocale(path, NULL); + fname = _Py_EncodeLocaleRaw(path, NULL); if (fname == NULL) { errno = EINVAL; return -1; } err = stat(fname, buf); - PyMem_Free(fname); + PyMem_RawFree(fname); return err; } -- cgit v1.2.1