diff -r 09105051b9f4 Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Sun Nov 03 21:31:38 2013 +0200 +++ b/Lib/idlelib/PyShell.py Mon Nov 04 10:44:36 2013 +0200 @@ -1334,8 +1334,10 @@ def write(self, s): if self.closed: raise ValueError("write to closed file") - if not isinstance(s, str): - raise TypeError('must be str, not ' + type(s).__name__) + if type(s) is not str: + if not isinstance(s, str): + raise TypeError('must be str, not ' + type(s).__name__) + s = str(s) return self.shell.write(s, self.tags)