From 0f98d8f8ead113933b569f2fce74229e4561f9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 13 Aug 2007 06:26:48 +0000 Subject: Allow str8 in .write(). --- Lib/idlelib/OutputWindow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/OutputWindow.py index 83d5771..330da76 100644 --- a/Lib/idlelib/OutputWindow.py +++ b/Lib/idlelib/OutputWindow.py @@ -35,7 +35,8 @@ class OutputWindow(EditorWindow): # Act as output file def write(self, s, tags=(), mark="insert"): - assert isinstance(s, str), repr(s) + if isinstance(s, (bytes, str8)): + s = s.decode(IOBinding.encoding, "replace") self.text.insert(mark, s, tags) self.text.see(mark) self.text.update() -- cgit v0.12