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 lemburg
Recipients alexandre.vassalotti, lemburg
Date 2008-05-10.14:11:12
SpamBayes Score 0.009180648
Marked as misclassified No
Message-id <1210428674.47.0.879458297518.issue2799@psf.upfronthosting.co.za>
In-reply-to
Content
IMO, it's better to correct API design errors early, rather than going
through a deprecation process.

Note that PyUnicode_AsString() is also different than its cousind
PyString_AsString(). 

PyString_AsString() is mostly used to access the char* buffer used by
the string object in order to change it, e.g. by first constructing a
new PyString object and then filling it in by accessing the internal
char* buffer directly.

Doing the same with PyUnicode_AsString() will not work. What's worse:
direct changes would go undetected, since the UTF8 PyString object is
held by the PyUnicode object internally.

Even if you just use PyUnicode_AsString() for reading and get the size
information from somewhere else, the API doesn't make sure that the
PyUnicode object doesn't have embedded 0 code points (which
PyString_AsString() does). PyUnicode_AsString() would have to use
PyString_AsString() for this instead of the PyString_AS_STRING() macro.
History
Date User Action Args
2008-05-10 14:11:15lemburgsetspambayes_score: 0.00918065 -> 0.009180648
recipients: + lemburg, alexandre.vassalotti
2008-05-10 14:11:14lemburgsetspambayes_score: 0.00918065 -> 0.00918065
messageid: <1210428674.47.0.879458297518.issue2799@psf.upfronthosting.co.za>
2008-05-10 14:11:13lemburglinkissue2799 messages
2008-05-10 14:11:12lemburgcreate