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.

作者 vstinner
收信人 Arfrever, amaury.forgeotdarc, ezio.melotti, lemburg, loewis, vstinner
日期 2010-03-05.12:13:50
SpamBayes Score 1.3163974e-05
Marked as misclassified
Message-id <1267791233.49.0.0382462451905.issue6697@psf.upfronthosting.co.za>
In-reply-to
内容
MaL> If you want a fail-safe stringified version of a Unicode object,
MaL> your only choice is to create a new API that does error checking,
MaL> properly clears the error and then returns a reference to a constant
MaL> string, e.g. "<repr-error>".

I wrote a function _PyUnicode_AsStringOrDefault(unicode, default_str) which call _PyUnicode_AsStringAndSize() and return the default_str on error. It can be used in error handler (places where you don't really like to reraise new error) or if you don't care about (unicode) errors.
历史
日期 用户 动作 参数
2010-03-05 12:13:53vstinner修改recipients: + vstinner, lemburg, loewis, amaury.forgeotdarc, ezio.melotti, Arfrever
2010-03-05 12:13:53vstinner修改messageid: <1267791233.49.0.0382462451905.issue6697@psf.upfronthosting.co.za>
2010-03-05 12:13:51vstinner链接issue6697 messages
2010-03-05 12:13:51vstinner创建