From e8e4e1456c8c168b5d1b5065280a50b3b5cf394f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 9 Jul 2012 21:01:49 +0200 Subject: - Issue #13532: Check that arguments to sys.stdout.write are strings. --- Lib/idlelib/PyShell.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index fa2e150933..14f062e09d 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1265,6 +1265,8 @@ class PseudoFile(object): self.encoding = encoding def write(self, s): + if not isinstance(s, str): + raise TypeError('must be str, not ' + type(s).__name__) self.shell.write(s, self.tags) def writelines(self, lines): -- cgit v1.2.1