Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
351ca4af
Commit
351ca4af
authored
Dec 10, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE
no more hangs.
parent
cdfe1b8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+10
-2
Misc/NEWS
Misc/NEWS
+6
-0
No files found.
Lib/idlelib/PyShell.py
View file @
351ca4af
...
...
@@ -1338,8 +1338,16 @@ class PseudoOutputFile(PseudoFile):
def
write
(
self
,
s
):
if
self
.
closed
:
raise
ValueError
(
"write to closed file"
)
if
not
isinstance
(
s
,
(
basestring
,
bytearray
)):
raise
TypeError
(
'must be string, not '
+
type
(
s
).
__name__
)
if
type
(
s
)
not
in
(
unicode
,
str
,
bytearray
):
# See issue #19481
if
isinstance
(
s
,
unicode
):
s
=
unicode
.
__getslice__
(
s
,
None
,
None
)
elif
isinstance
(
s
,
str
):
s
=
str
.
__str__
(
s
)
elif
isinstance
(
s
,
bytearray
):
s
=
bytearray
.
__str__
(
s
)
else
:
raise
TypeError
(
'must be string, not '
+
type
(
s
).
__name__
)
return
self
.
shell
.
write
(
s
,
self
.
tags
)
...
...
Misc/NEWS
View file @
351ca4af
...
...
@@ -68,6 +68,12 @@ Library
-
Issue
#
19286
:
Directories
in
``
package_data
``
are
no
longer
added
to
the
filelist
,
preventing
failure
outlined
in
the
ticket
.
IDLE
----
-
Issue
#
19481
:
print
()
of
unicode
,
str
or
bytearray
subclass
instance
in
IDLE
no
more
hangs
.
Tests
-----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment