]> granicus.if.org Git - python/commitdiff
Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 17 Jun 2010 21:43:33 +0000 (21:43 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 17 Jun 2010 21:43:33 +0000 (21:43 +0000)
Lib/idlelib/textView.py
Misc/NEWS

index 3f3c24778914713d988c5375e1069027929c080b..e5c551ad83a689e52777c1267f878106b7f1750b 100644 (file)
@@ -62,11 +62,7 @@ def view_text(parent, title, text):
 
 def view_file(parent, title, filename, encoding=None):
     try:
-        if encoding:
-            import codecs
-            textFile = codecs.open(filename, 'r')
-        else:
-            textFile = open(filename, 'r')
+        textFile = open(filename, 'r', encoding=encoding)
     except IOError:
         import tkinter.messagebox as tkMessageBox
         tkMessageBox.showerror(title='File Load Error',
index 41ac42dd6b2bf1f8205a8c69cecfc595f7c5a703..121e92d0c290752569c85c06342cd1222f65b58e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2047,6 +2047,8 @@ Installation
 Library
 -------
 
+- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
+
 - Issue #5311: bdist_msi can now build packages that do not depend on a
   specific Python version.