From: Victor Stinner Date: Thu, 17 Jun 2010 21:45:56 +0000 (+0000) Subject: Merged revisions 82057 via svnmerge from X-Git-Tag: v3.1.3rc1~618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=428b4e3eeeaba64ec9507db1b8a09ed16f41dad7;p=python Merged revisions 82057 via svnmerge from 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. ........ --- diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py index 3f3c247789..e5c551ad83 100644 --- a/Lib/idlelib/textView.py +++ b/Lib/idlelib/textView.py @@ -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', diff --git a/Misc/NEWS b/Misc/NEWS index 91c65a6507..38533dd1ef 100644 --- 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.