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:
Miss Islington (bot) 2020-06-29 17:36:46 -07:00 committed by GitHub
parent 9a646aa82d
commit 01638ce51a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 52 deletions

View file

@ -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()