From: Victor Stinner Date: Thu, 17 Jun 2010 21:43:33 +0000 (+0000) Subject: Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument. X-Git-Tag: v3.2a1~504 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=870f09a7f4296712de404dccea1c3a7bf52f66c3;p=python 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 41ac42dd6b..121e92d0c2 100644 --- 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.