summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:43:33 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-17 21:43:33 (GMT)
commit870f09a7f4296712de404dccea1c3a7bf52f66c3 (patch)
tree451c98f6c8e68d5dfc3aac4ad68a4b96d1fbbdf3 /Lib/idlelib
parent7c9627b4de767ca794ab6086b1fd64b02fb3e235 (diff)
downloadcpython-870f09a7f4296712de404dccea1c3a7bf52f66c3.zip
cpython-870f09a7f4296712de404dccea1c3a7bf52f66c3.tar.gz
cpython-870f09a7f4296712de404dccea1c3a7bf52f66c3.tar.bz2
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',