Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 102f825

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

File tree

Expand file treeCollapse file tree

2 files changed

+2
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

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

‎Python/fileutils.c

Copy file name to clipboardExpand all lines: Python/fileutils.c
+1-9Lines changed: 1 addition & 9 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.