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 nikratio
Recipients docs@python, nikratio
Date 2010-10-09.23:37:54
SpamBayes Score 7.625793e-07
Marked as misclassified No
Message-id <1286667477.81.0.428824967814.issue10058@psf.upfronthosting.co.za>
In-reply-to
Content
http://docs.python.org/c-api/string.html says about the return value of AsStringAndSize:

"If length is NULL, the resulting buffer may not contain NUL characters; if it does, the function returns -1 and a TypeError is raised."

"If string is not a string object at all, PyString_AsStringAndSize() returns -1 and raises TypeError."

This makes me wonder what the return code is if a) the function succeeds and b) it encounteres some other problem (i.e. out of memory when it tries to encode a unicode string into its default encoding).

I guess that the return value is 0 on success and -1 on all errors, but it would be nice if the documentation would be clear about this.
History
Date User Action Args
2010-10-09 23:37:58nikratiosetrecipients: + nikratio, docs@python
2010-10-09 23:37:57nikratiosetmessageid: <1286667477.81.0.428824967814.issue10058@psf.upfronthosting.co.za>
2010-10-09 23:37:55nikratiolinkissue10058 messages
2010-10-09 23:37:54nikratiocreate