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 belopolsky, martin.panter, musically_ut, r.david.murray, serhiy.storchaka, vstinner
Date 2017-07-01.05:04:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Isn’t there a “Unicode writer” API that could be used?

It could be used if accumulate only Python strings, C strings and separate characters. But in any case we need to convert C integers to strings, and add up to 3 items per every attribute (separator, name, value), the result of every addition should be checked. PyUnicode_FromFormat() is an easy way to concatenate several items. It needs only one check.

> The annoying part is to handle the ", " separator. I also had bad experiences with handling char* strings. It's so easy to make mistakes :-(

It could be simpler if use the trick with the sep variable. As for mistakes, actually that version of Utkarsh's patch was less buggy than the few following versions using the Python C API. But the final C code is correct and LGTM.
Date User Action Args
2017-07-01 05:04:46serhiy.storchakasetrecipients: + serhiy.storchaka, belopolsky, vstinner, r.david.murray, martin.panter, musically_ut
2017-07-01 05:04:46serhiy.storchakasetmessageid: <>
2017-07-01 05:04:46serhiy.storchakalinkissue30302 messages
2017-07-01 05:04:46serhiy.storchakacreate