Skip to content

Commit 102f825

Browse files
gh-124476: Fix decoding from the locale encoding in the C.UTF-8 locale (GH-132477)
1 parent 6163841 commit 102f825

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix decoding from the locale encoding in the C.UTF-8 locale.

Diff for: Python/fileutils.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,7 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
528528
break;
529529
}
530530

531-
if (converted == INCOMPLETE_CHARACTER) {
532-
/* Incomplete character. This should never happen,
533-
since we provide everything that we have -
534-
unless there is a bug in the C library, or I
535-
misunderstood how mbrtowc works. */
536-
goto decode_error;
537-
}
538-
539-
if (converted == DECODE_ERROR) {
531+
if (converted == DECODE_ERROR || converted == INCOMPLETE_CHARACTER) {
540532
if (!surrogateescape) {
541533
goto decode_error;
542534
}

0 commit comments

Comments
 (0)