Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb42b02

Browse files
committed
Add encoding name in LookupError. Fixes #615013. Will backport to 2.2.
1 parent 6d817ad commit eb42b02

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/codecs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ PyObject *_PyCodec_Lookup(const char *encoding)
197197
}
198198
if (i == len) {
199199
/* XXX Perhaps we should cache misses too ? */
200-
PyErr_SetString(PyExc_LookupError,
201-
"unknown encoding");
200+
PyErr_Format(PyExc_LookupError,
201+
"unknown encoding: %s", encoding);
202202
goto onError;
203203
}
204204

0 commit comments

Comments
 (0)