[Python-checkins] python/dist/src/Python exceptions.c,1.45,1.46

doerwalter at users.sourceforge.net doerwalter at users.sourceforge.net
Tue Aug 12 11:34:51 EDT 2003


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv14911/Python

Modified Files:
	exceptions.c 
Log Message:
Add a unicode prefix to the characters in the UnicodeEncodeError and
UnicodeTranslateError message.


Index: exceptions.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** exceptions.c	12 Aug 2003 17:32:43 -0000	1.45
--- exceptions.c	12 Aug 2003 17:34:49 -0000	1.46
***************
*** 1255,1263 ****
  	char *format;
  	if (badchar <= 0xff)
! 	   format = "'%.400s' codec can't encode character '\\x%02x' in position %d: %.400s";
  	else if (badchar <= 0xffff)
! 	   format = "'%.400s' codec can't encode character '\\u%04x' in position %d: %.400s";
  	else
! 	   format = "'%.400s' codec can't encode character '\\U%08x' in position %d: %.400s";
  	PyOS_snprintf(buffer, sizeof(buffer),
  	    format,
--- 1255,1263 ----
  	char *format;
  	if (badchar <= 0xff)
! 	   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'\\u%04x' in position %d: %.400s";
  	else
! 	   format = "'%.400s' codec can't encode character u'\\U%08x' in position %d: %.400s";
  	PyOS_snprintf(buffer, sizeof(buffer),
  	    format,
***************
*** 1450,1458 ****
  	char *format;
  	if (badchar <= 0xff)
! 	   format = "can't translate character '\\x%02x' in position %d: %.400s";
  	else if (badchar <= 0xffff)
! 	   format = "can't translate character '\\u%04x' in position %d: %.400s";
  	else
! 	   format = "can't translate character '\\U%08x' in position %d: %.400s";
  	PyOS_snprintf(buffer, sizeof(buffer),
  	    format,
--- 1450,1458 ----
  	char *format;
  	if (badchar <= 0xff)
! 	   format = "can't translate character u'\\x%02x' in position %d: %.400s";
  	else if (badchar <= 0xffff)
! 	   format = "can't translate character u'\\u%04x' in position %d: %.400s";
  	else
! 	   format = "can't translate character u'\\U%08x' in position %d: %.400s";
  	PyOS_snprintf(buffer, sizeof(buffer),
  	    format,





More information about the Python-checkins mailing list