]> granicus.if.org Git - python/commitdiff
Merged revisions 82057 via svnmerge from
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 17 Jun 2010 21:45:56 +0000 (21:45 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 17 Jun 2010 21:45:56 +0000 (21:45 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82057 | victor.stinner | 2010-06-17 23:43:33 +0200 (jeu., 17 juin 2010) | 2 lines

  Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
........

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 91c65a6507d2f01c2ff4bd4c19e04370759acb08..38533dd1ef04cfb7bc41fc30d05f142ece4d36f7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -66,6 +66,8 @@ C-API
 Library
 -------
 
+- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
+
 - Issue #8720: fix regression caused by fix for #4050 by making getsourcefile
   smart enough to find source files in the linecache.