diff options
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b6f3d8f..51d314b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3354,6 +3354,10 @@ PyUnicode_Decode(const char *s, return NULL; } + if (size == 0) { + _Py_RETURN_UNICODE_EMPTY(); + } + if (encoding == NULL) { return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } |