Author serhiy.storchaka
Recipients ezio.melotti, serhiy.storchaka, vstinner
Date 2017-07-06.07:53:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Since Python 3.3 PyUnicode_AsUnicodeAndSize() is deprecated in favour of PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). But the latter two are implemented using PyUnicode_AsUnicodeAndSize(). This prevents adding the deprecation compiler warning for PyUnicode_AsUnicodeAndSize(). Other side effect -- PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() cache the wchar_t* representation of the PyUnicode object increasing its memory consumption.

Proposed patch reimplements PyUnicode_AsWideChar(), PyUnicode_AsWideCharString() and PyUnicode_AsUnicodeAndSize() using two common helper functions. PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() no longer cache the wchar_t* representation.
Date User Action Args
2017-07-06 07:53:21serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, ezio.melotti
2017-07-06 07:53:21serhiy.storchakasetmessageid: <>
2017-07-06 07:53:21serhiy.storchakalinkissue30863 messages
2017-07-06 07:53:21serhiy.storchakacreate