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
7de3772b
Commit
7de3772b
authored
Jun 15, 2003
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forwardport Patch from IDLEfork SF 615312
Convert characters from the locale's encoding on output
parent
9e8b828f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Lib/idlelib/OutputWindow.py
Lib/idlelib/OutputWindow.py
+9
-0
No files found.
Lib/idlelib/OutputWindow.py
View file @
7de3772b
...
...
@@ -2,6 +2,7 @@ from Tkinter import *
from
EditorWindow
import
EditorWindow
import
re
import
tkMessageBox
import
IOBinding
class
OutputWindow
(
EditorWindow
):
...
...
@@ -34,6 +35,14 @@ class OutputWindow(EditorWindow):
# Act as output file
def
write
(
self
,
s
,
tags
=
(),
mark
=
"insert"
):
# Tk assumes that byte strings are Latin-1;
# we assume that they are in the locale's encoding
if
isinstance
(
s
,
str
):
try
:
s
=
unicode
(
s
,
IOBinding
.
encoding
)
except
UnicodeError
:
# some other encoding; let Tcl deal with it
pass
self
.
text
.
insert
(
mark
,
s
,
tags
)
self
.
text
.
see
(
mark
)
self
.
text
.
update
()
...
...
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