summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:43:33 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:43:33 +0000
commit4b18fc31b450e481513e65d6414f1752bbc90fb0 (patch)
tree22783e3b5f96758c0b78b9d9a1a960905a403117
parent038a84f24c322e32ca611eabbcec4830fb2b30f1 (diff)
downloadcpython-4b18fc31b450e481513e65d6414f1752bbc90fb0.tar.gz
Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
-rw-r--r--Lib/idlelib/textView.py6
-rw-r--r--Misc/NEWS2
2 files changed, 3 insertions, 5 deletions
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.