@@ -755,7 +755,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
755755 char fmt [61 ]; /* should be enough for %0width.precisionlld */
756756 const char * copy ;
757757
758- Py_VA_COPY (count , vargs );
758+ Py_VA_COPY (count , vargs );
759759 /* step 1: count the number of %S/%R/%A/%s format specifications
760760 * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII()/
761761 * PyUnicode_DecodeUTF8() for these objects once during step 3 and put the
@@ -1548,12 +1548,13 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
15481548
15491549 /* If the codec returns a buffer, raise a warning and convert to bytes */
15501550 if (PyByteArray_Check (v )) {
1551- char msg [ 100 ] ;
1551+ int error ;
15521552 PyObject * b ;
1553- PyOS_snprintf (msg , sizeof (msg ),
1554- "encoder %s returned buffer instead of bytes" ,
1555- encoding );
1556- if (PyErr_WarnEx (PyExc_RuntimeWarning , msg , 1 ) < 0 ) {
1553+
1554+ error = PyErr_WarnFormat (PyExc_RuntimeWarning , 1 ,
1555+ "encoder %s returned bytearray instead of bytes" ,
1556+ encoding );
1557+ if (error ) {
15571558 Py_DECREF (v );
15581559 return NULL ;
15591560 }
@@ -2279,7 +2280,7 @@ char utf8_code_length[256] = {
22792280 illegal prefix. See RFC 3629 for details */
22802281 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , /* 00-0F */
22812282 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
2282- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
2283+ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
22832284 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
22842285 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
22852286 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
0 commit comments