diff --git a/Misc/NEWS b/Misc/NEWS index e26a5c05aba..0a021ea1557 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -29,6 +29,9 @@ Core and Builtins Library ------- +- Issue #28200: Fix memory leak on Windows in the os module (fix + path_converter() function). + - Issue #25400: RobotFileParser now correctly returns default values for crawl_delay and request_rate. Initial patch by Peter Wirtz. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ba54249684d..470ee92fa19 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -920,7 +920,7 @@ path_converter(PyObject *o, void *p) if (is_unicode) { #ifdef MS_WINDOWS - wide = PyUnicode_AsWideCharString(o, &length); + wide = PyUnicode_AsUnicodeAndSize(o, &length); if (!wide) { goto exit; }