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 vstinner
Recipients vstinner
Date 2010-06-13.21:15:26
SpamBayes Score 3.180122e-05
Marked as misclassified No
Message-id <1276463733.12.0.346579334159.issue8992@psf.upfronthosting.co.za>
In-reply-to
Content
If convertitem() result is not NULL, an error occured and seterror() is called (by the function calling convertitem()). seterror() does nothing if an exception was raised (if PyErr_Occurred() is non zero).

convertitem() doesn't need to call converterr() if an exception occurred because the string formatted by converterr() will be ignored. We just need to return a non NULL pointer: msgbuf.

Attached patch creates a RETURN_ERR_OCCURRED macro. convertsimple() should be a little bit faster and the code is more readable. Details:
 - addcleanup() now takes a boolean to indicate if it's a buffer or a pointer to simplify the API and have to raise a special error if the destructor is unknown
 - don't check that the result of PyUnicode_AsEncodedString() is a bytes object: PyUnicode_AsEncodedString() does already check that
History
Date User Action Args
2010-06-13 21:15:33vstinnersetrecipients: + vstinner
2010-06-13 21:15:33vstinnersetmessageid: <1276463733.12.0.346579334159.issue8992@psf.upfronthosting.co.za>
2010-06-13 21:15:28vstinnerlinkissue8992 messages
2010-06-13 21:15:28vstinnercreate