[Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.95,2.96 unicodeobject.c,2.67,2.68

A.M. Kuchling python-dev@python.org
Fri, 15 Dec 2000 05:07:49 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv10322

Modified Files:
	stringobject.c unicodeobject.c 
Log Message:
[ Patch #102852 ] Make % error a bit more informative by indicates the
index at which an unknown %-escape was found


Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.95
retrieving revision 2.96
diff -C2 -r2.95 -r2.96
*** stringobject.c	2000/12/06 14:27:49	2.95
--- stringobject.c	2000/12/15 13:07:46	2.96
***************
*** 2940,2945 ****
  			default:
  				PyErr_Format(PyExc_ValueError,
! 				"unsupported format character '%c' (0x%x)",
! 					c, c);
  				goto error;
  			}
--- 2940,2946 ----
  			default:
  				PyErr_Format(PyExc_ValueError,
! 				  "unsupported format character '%c' (0x%x) "
! 				  "at index %i",
! 				  c, c, fmt - 1 - PyString_AsString(format));
  				goto error;
  			}

Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.67
retrieving revision 2.68
diff -C2 -r2.67 -r2.68
*** unicodeobject.c	2000/11/30 05:22:44	2.67
--- unicodeobject.c	2000/12/15 13:07:46	2.68
***************
*** 5068,5073 ****
  	    default:
  		PyErr_Format(PyExc_ValueError,
! 			     "unsupported format character '%c' (0x%x)",
! 			     c, c);
  		goto onError;
  	    }
--- 5068,5074 ----
  	    default:
  		PyErr_Format(PyExc_ValueError,
! 			     "unsupported format character '%c' (0x%x) "
! 			     "at index %i",
! 			     c, c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
  		goto onError;
  	    }