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 f218549

Browse filesBrowse files
[3.13] gh-124476: Fix decoding from the locale encoding in the C.UTF-8 locale (GH-132477) (ПР-132528)
(cherry picked from commit 102f825)
1 parent bdff88b commit f218549
Copy full SHA for f218549

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
@@ -523,15 +523,7 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
523523
break;
524524
}
525525

526-
if (converted == INCOMPLETE_CHARACTER) {
527-
/* Incomplete character. This should never happen,
528-
since we provide everything that we have -
529-
unless there is a bug in the C library, or I
530-
misunderstood how mbrtowc works. */
531-
goto decode_error;
532-
}
533-
534-
if (converted == DECODE_ERROR) {
526+
if (converted == DECODE_ERROR || converted == INCOMPLETE_CHARACTER) {
535527
if (!surrogateescape) {
536528
goto decode_error;
537529
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.