Skip to content
Merged
Prev Previous commit
Next Next commit
Fix one more issue introduced with bpo-35883
  • Loading branch information
kulikjak committed Apr 28, 2021
commit 4aebe1d9e6c06477e46ba69aa5380e10418046be
6 changes: 6 additions & 0 deletions Python/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ _Py_device_encoding(int fd)
static size_t
is_valid_wide_char(wchar_t ch)
{
#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION
/* Oracle Solaris doesn't use Unicode code points as wchar_t encoding
for non-Unicode locales, which makes values higher than MAX_UNICODE
possibly valid. */
return 1;
#endif
if (Py_UNICODE_IS_SURROGATE(ch)) {
// Reject lone surrogate characters
return 0;
Expand Down