changeset: 87871:d462b2bf875b branch: 3.3 parent: 87861:7b077c691fef user: Serhiy Storchaka date: Tue Dec 10 10:05:19 2013 +0200 files: Lib/idlelib/PyShell.py Misc/NEWS description: Issue #19481: print() of string subclass instance in IDLE no more hangs. diff -r 7b077c691fef -r d462b2bf875b Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Tue Dec 10 01:19:58 2013 +0100 +++ b/Lib/idlelib/PyShell.py Tue Dec 10 10:05:19 2013 +0200 @@ -1331,8 +1331,11 @@ 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__) + # See issue #19481 + s = str.__str__(s) return self.shell.write(s, self.tags) diff -r 7b077c691fef -r d462b2bf875b Misc/NEWS --- a/Misc/NEWS Tue Dec 10 01:19:58 2013 +0100 +++ b/Misc/NEWS Tue Dec 10 10:05:19 2013 +0200 @@ -106,6 +106,11 @@ - Issue #19286: Directories in ``package_data`` are no longer added to the filelist, preventing failure outlined in the ticket. +IDLE +---- + +- Issue #19481: print() of string subclass instance in IDLE no more hangs. + Tests -----