Message91742
> 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. |
|
Date |
User |
Action |
Args |
2009-08-19 20:20:06 | loewis | set | recipients:
+ loewis, lemburg, amaury.forgeotdarc, vstinner, Arfrever |
2009-08-19 20:20:04 | loewis | link | issue6697 messages |
2009-08-19 20:20:04 | loewis | create | |
|