mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
This commit is contained in:
parent
7c9627b4de
commit
870f09a7f4
2 changed files with 3 additions and 5 deletions
|
|
@ -62,11 +62,7 @@ def view_text(parent, title, text):
|
||||||
|
|
||||||
def view_file(parent, title, filename, encoding=None):
|
def view_file(parent, title, filename, encoding=None):
|
||||||
try:
|
try:
|
||||||
if encoding:
|
textFile = open(filename, 'r', encoding=encoding)
|
||||||
import codecs
|
|
||||||
textFile = codecs.open(filename, 'r')
|
|
||||||
else:
|
|
||||||
textFile = open(filename, 'r')
|
|
||||||
except IOError:
|
except IOError:
|
||||||
import tkinter.messagebox as tkMessageBox
|
import tkinter.messagebox as tkMessageBox
|
||||||
tkMessageBox.showerror(title='File Load Error',
|
tkMessageBox.showerror(title='File Load Error',
|
||||||
|
|
|
||||||
|
|
@ -2047,6 +2047,8 @@ Installation
|
||||||
Library
|
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
|
- Issue #5311: bdist_msi can now build packages that do not depend on a
|
||||||
specific Python version.
|
specific Python version.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue