diff --git a/Misc/NEWS b/Misc/NEWS index 9909020aef93..161de763e92a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1 Core and Builtins ----------------- +- Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X + when decode astral characters. Patch by Xiang Zhang. + - Issue #28665: Improve speed of the STORE_DEREF opcode by 40%. - Issue #19398: Extra slash no longer added to sys.path components in case of diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index e22eed8853fe..ab363575c5cf 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5101,7 +5101,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size) #if SIZEOF_WCHAR_T == 4 assert(0); #else - assert(Py_UNICODE_IS_SURROGATE(ch)); + assert(ch > 0xFFFF && ch <= MAX_UNICODE); /* compute and append the two surrogates: */ unicode[outpos++] = (wchar_t)Py_UNICODE_HIGH_SURROGATE(ch); unicode[outpos++] = (wchar_t)Py_UNICODE_LOW_SURROGATE(ch);