Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.

This commit is contained in:
Victor Stinner 2010-06-17 21:43:33 +00:00
parent 7c9627b4de
commit 870f09a7f4
2 changed files with 3 additions and 5 deletions

View file

@ -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',