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 eric.smith
Recipients doerwalter, eric.smith, ezio.melotti, flox, vstinner
Date 2010-02-22.22:20:55
SpamBayes Score 2.707414e-08
Marked as misclassified No
Message-id <1266877257.75.0.736836990506.issue7649@psf.upfronthosting.co.za>
In-reply-to
Content
Could you add a comment on why you're calling PyUnicode_FromString and then throwing away the result? I believe it's so you'll get the same error checking as PyUnicode_FromString, but it's sufficiently tricky that I think it deserves a comment.

Now that I think about it, having done the conversion in PyUnicode_FromString, why not use:
buf[0] = PyUnicode_AS_UNICODE(s)[0];
? This way you skip the cast and you know for a fact you're using the same interpretation as PyUnicode_FromString, having used its output.

Also, since you know the size you may as well call PyUnicode_FromStringAndSize. It's trivially faster and makes the intent clearer, I think.
History
Date User Action Args
2010-02-22 22:20:57eric.smithsetrecipients: + eric.smith, doerwalter, vstinner, ezio.melotti, flox
2010-02-22 22:20:57eric.smithsetmessageid: <1266877257.75.0.736836990506.issue7649@psf.upfronthosting.co.za>
2010-02-22 22:20:56eric.smithlinkissue7649 messages
2010-02-22 22:20:55eric.smithcreate