summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:45:56 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:45:56 (GMT)
commit428b4e3eeeaba64ec9507db1b8a09ed16f41dad7 (patch)
treea4dfbfff56c652712a1411edf014a6cfcfb177cd /Lib/idlelib
parent3ff73848f259a661bd4c85ccee6d463ad862b15f (diff)
downloadcpython-428b4e3eeeaba64ec9507db1b8a09ed16f41dad7.zip
cpython-428b4e3eeeaba64ec9507db1b8a09ed16f41dad7.tar.gz
cpython-428b4e3eeeaba64ec9507db1b8a09ed16f41dad7.tar.bz2
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. ........
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/textView.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
index 3f3c247..e5c551a 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',