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.

作者 loewis
收信人 Arfrever, amaury.forgeotdarc, lemburg, loewis, vstinner
日期 2009-08-19.20:20:04
SpamBayes Score 2.260816e-08
Marked as misclassified
Message-id <4A8C5E73.4060508@v.loewis.de>
In-reply-to <1250685240.55.0.880064208852.issue6697@psf.upfronthosting.co.za>
内容
> It would be unfortunate to replace all usages of _PyUnicode_AsString to
> check the return value.

I agree with MAL: we do need to check for errors returned from
_PyUnicode_AsString, and it would be best if we created a fail-safe
version of it.

In the specific case (getattr), it might also be useful to create a
result that is unicode-escaped, i.e. with \u escapes for all non-ASCII
non-printable characters.

For _PyUnicode_AsString, I'm uncertain whether supporting half
surrogates is a good idea. Unless there is a compelling reason to
support them, I think we leave that as-is. Your example is not
compelling: I think the unicode string should be escaped, anyway.

The OP's case is also not compelling, we should print an error
message that the source code is incorrectly encoded.
历史
日期 用户 动作 参数
2009-08-19 20:20:06loewis修改recipients: + loewis, lemburg, amaury.forgeotdarc, vstinner, Arfrever
2009-08-19 20:20:04loewis链接issue6697 messages
2009-08-19 20:20:04loewis创建