summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/textView.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/textView.py')
-rw-r--r--Lib/idlelib/textView.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
index 8687d40..b8c4ac1 100644
--- a/Lib/idlelib/textView.py
+++ b/Lib/idlelib/textView.py
@@ -79,6 +79,10 @@ def view_file(parent, title, filename, encoding=None, modal=True):
tkMessageBox.showerror(title='File Load Error',
message='Unable to load file %r .' % filename,
parent=parent)
+ except UnicodeDecodeError as err:
+ showerror(title='Unicode Decode Error',
+ message=str(err),
+ parent=parent)
else:
return view_text(parent, title, textFile.read(), modal)