This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1499327601.89.0.422030261957.issue30863@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-07-06 07:53:21serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, ezio.melotti
2017-07-06 07:53:21serhiy.storchakasetmessageid: <1499327601.89.0.422030261957.issue30863@psf.upfronthosting.co.za>
2017-07-06 07:53:21serhiy.storchakalinkissue30863 messages
2017-07-06 07:53:21serhiy.storchakacreate