mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Closes #23247: Fix a crash in the StreamWriter.reset() of CJK codecs
This commit is contained in:
parent
b37f43f94b
commit
579db160b3
3 changed files with 12 additions and 0 deletions
|
@ -1629,6 +1629,9 @@ mbstreamwriter_reset(MultibyteStreamWriterObject *self)
|
|||
{
|
||||
PyObject *pwrt;
|
||||
|
||||
if (!self->pending)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
pwrt = multibytecodec_encode(self->codec, &self->state,
|
||||
self->pending, NULL, self->errors,
|
||||
MBENC_FLUSH | MBENC_RESET);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue