Commit 6058198
committed
Fix: handle surrogate pairs in FileHistory.store_string
FileHistory.store_string crashes with UnicodeEncodeError when the
input string contains surrogate pairs (e.g., from Windows clipboard
containing emoji). Add errors='replace' to gracefully handle invalid
surrogates by replacing them with the Unicode replacement character.
Fixes #20611 parent 940af53 commit 6058198
2 files changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
0 commit comments