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 loewis
Recipients Arfrever, amaury.forgeotdarc, lemburg, loewis, vstinner
Date 2009-08-19.20:20:04
SpamBayes Score 2.260816e-08
Marked as misclassified No
Message-id <4A8C5E73.4060508@v.loewis.de>
In-reply-to <1250685240.55.0.880064208852.issue6697@psf.upfronthosting.co.za>
Content
> 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.
History
Date User Action Args
2009-08-19 20:20:06loewissetrecipients: + loewis, lemburg, amaury.forgeotdarc, vstinner, Arfrever
2009-08-19 20:20:04loewislinkissue6697 messages
2009-08-19 20:20:04loewiscreate