mirror of
https://github.com/python/cpython.git
synced 2025-10-28 20:25:04 +00:00
bpo-41152: IDLE: always use UTF-8 for standard IO streams (GH-21214)
(cherry picked from commit 2515a28230)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
9a646aa82d
commit
01638ce51a
5 changed files with 10 additions and 52 deletions
|
|
@ -6,7 +6,6 @@
|
|||
from tkinter import messagebox
|
||||
|
||||
from idlelib.editor import EditorWindow
|
||||
from idlelib import iomenu
|
||||
|
||||
|
||||
file_line_pats = [
|
||||
|
|
@ -110,8 +109,7 @@ def write(self, s, tags=(), mark="insert"):
|
|||
Return:
|
||||
Length of text inserted.
|
||||
"""
|
||||
if isinstance(s, bytes):
|
||||
s = s.decode(iomenu.encoding, "replace")
|
||||
assert isinstance(s, str)
|
||||
self.text.insert(mark, s, tags)
|
||||
self.text.see(mark)
|
||||
self.text.update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue