Message118294
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. |
|
Date |
User |
Action |
Args |
2010-10-09 23:37:58 | nikratio | set | recipients:
+ nikratio, docs@python |
2010-10-09 23:37:57 | nikratio | set | messageid: <1286667477.81.0.428824967814.issue10058@psf.upfronthosting.co.za> |
2010-10-09 23:37:55 | nikratio | link | issue10058 messages |
2010-10-09 23:37:54 | nikratio | create | |
|