mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
platforms, and assorted locale fixes by Derk Drukker.
This commit is contained in:
parent
86906f7831
commit
6a448d4c2e
5 changed files with 52 additions and 13 deletions
|
@ -9,6 +9,7 @@ This software comes with no warranty. Use at your own risk.
|
|||
|
||||
******************************************************************/
|
||||
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
#include "Python.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -315,7 +316,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
|
|||
result = PyUnicode_FromWideChar(buf, n2);
|
||||
exit:
|
||||
if (buf) PyMem_Free(buf);
|
||||
#ifdef HAVE_USABLE_WCHAR_T
|
||||
#ifndef HAVE_USABLE_WCHAR_T
|
||||
PyMem_Free(s);
|
||||
#endif
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue