Skip to content

Commit 943e57e

Browse files
picnixzvstinner
andauthored
[3.13] Fix Unicode encode_wstr_utf8() (#127420) (#127505)
Fix Unicode encode_wstr_utf8() (#127420) Raise RuntimeError instead of RuntimeWarning. Co-authored-by: Victor Stinner <[email protected]>
1 parent 585d48f commit 943e57e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15633,7 +15633,7 @@ encode_wstr_utf8(wchar_t *wstr, char **str, const char *name)
1563315633
int res;
1563415634
res = _Py_EncodeUTF8Ex(wstr, str, NULL, NULL, 1, _Py_ERROR_STRICT);
1563515635
if (res == -2) {
15636-
PyErr_Format(PyExc_RuntimeWarning, "cannot decode %s", name);
15636+
PyErr_Format(PyExc_RuntimeError, "cannot encode %s", name);
1563715637
return -1;
1563815638
}
1563915639
if (res < 0) {

0 commit comments

Comments
 (0)