diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-08-12 17:34:49 +0000 |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-08-12 17:34:49 +0000 |
commit | 2415105eb5411e8245f3143068d1ca825159f6c2 (patch) | |
tree | 17bdb0fe80d228529396dd81480b8cd9121ef036 /Python/exceptions.c | |
parent | 525b0f9d1dd48c850a21c0b8f07fc93d8bb88ea0 (diff) | |
download | cpython-2415105eb5411e8245f3143068d1ca825159f6c2.tar.gz |
Add a unicode prefix to the characters in the UnicodeEncodeError and
UnicodeTranslateError message.
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r-- | Python/exceptions.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c index d49b364e85..da78f2b19d 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -1254,11 +1254,11 @@ UnicodeEncodeError__str__(PyObject *self, PyObject *arg) int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; char *format; if (badchar <= 0xff) - format = "'%.400s' codec can't encode character '\\x%02x' in position %d: %.400s"; + format = "'%.400s' codec can't encode character u'\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) - format = "'%.400s' codec can't encode character '\\u%04x' in position %d: %.400s"; + format = "'%.400s' codec can't encode character u'\\u%04x' in position %d: %.400s"; else - format = "'%.400s' codec can't encode character '\\U%08x' in position %d: %.400s"; + format = "'%.400s' codec can't encode character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, PyString_AS_STRING(encodingObj), @@ -1449,11 +1449,11 @@ UnicodeTranslateError__str__(PyObject *self, PyObject *arg) int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; char *format; if (badchar <= 0xff) - format = "can't translate character '\\x%02x' in position %d: %.400s"; + format = "can't translate character u'\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) - format = "can't translate character '\\u%04x' in position %d: %.400s"; + format = "can't translate character u'\\u%04x' in position %d: %.400s"; else - format = "can't translate character '\\U%08x' in position %d: %.400s"; + format = "can't translate character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, badchar, |