diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 154640ee582..d4f7d01197b 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -529,7 +529,7 @@ formatchar(char *buf, size_t buflen, PyObject *v) "%c requires an integer in range(256) or a single byte"); goto error; } - buf[0] = ival; + buf[0] = (char)ival; } Py_XDECREF(w); buf[1] = '\0';