bpo-32837: IDLE - require encoding argument for textview.view_file. (GH-5646)
Using the system and place-dependent default encoding for open()
is a bad idea for IDLE's system and location-independent files.
diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py
index e3b5506..6620134 100644
--- a/Lib/idlelib/textview.py
+++ b/Lib/idlelib/textview.py
@@ -107,7 +107,7 @@
return ViewWindow(parent, title, text, modal, _utest=_utest)
-def view_file(parent, title, filename, encoding=None, modal=True, _utest=False):
+def view_file(parent, title, filename, encoding, modal=True, _utest=False):
"""Create text viewer for text in filename.
Return error message if file cannot be read. Otherwise calls view_text