Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e7c8fdee
Kaydet (Commit)
e7c8fdee
authored
Mar 14, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge heads
üst
2f9bf350
8247b188
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
0 deletions
+40
-0
PyShell.py
Lib/idlelib/PyShell.py
+10
-0
rpc.py
Lib/idlelib/rpc.py
+7
-0
run.py
Lib/idlelib/run.py
+21
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
e7c8fdee
...
...
@@ -1221,6 +1221,16 @@ class PyShell(OutputWindow):
self
.
set_line_and_column
()
def
write
(
self
,
s
,
tags
=
()):
if
isinstance
(
s
,
str
)
and
len
(
s
)
and
max
(
s
)
>
'
\uffff
'
:
# Tk doesn't support outputting non-BMP characters
# Let's assume what printed string is not very long,
# find first non-BMP character and construct informative
# UnicodeEncodeError exception.
for
start
,
char
in
enumerate
(
s
):
if
char
>
'
\uffff
'
:
break
raise
UnicodeEncodeError
(
"UCS-2"
,
char
,
start
,
start
+
1
,
'Non-BMP character not supported in Tk'
)
try
:
self
.
text
.
mark_gravity
(
"iomark"
,
"right"
)
OutputWindow
.
write
(
self
,
s
,
tags
,
"iomark"
)
...
...
Lib/idlelib/rpc.py
Dosyayı görüntüle @
e7c8fdee
...
...
@@ -196,8 +196,12 @@ class SocketIO(object):
return
(
"ERROR"
,
"Unsupported message type:
%
s"
%
how
)
except
SystemExit
:
raise
except
KeyboardInterrupt
:
raise
except
socket
.
error
:
raise
except
Exception
as
ex
:
return
(
"CALLEXC"
,
ex
)
except
:
msg
=
"*** Internal Error: rpc.py:SocketIO.localcall()
\n\n
"
\
" Object:
%
s
\n
Method:
%
s
\n
Args:
%
s
\n
"
...
...
@@ -257,6 +261,9 @@ class SocketIO(object):
if
how
==
"ERROR"
:
self
.
debug
(
"decoderesponse: Internal ERROR:"
,
what
)
raise
RuntimeError
(
what
)
if
how
==
"CALLEXC"
:
self
.
debug
(
"decoderesponse: Call Exception:"
,
what
)
raise
what
raise
SystemError
(
how
,
what
)
def
decode_interrupthook
(
self
):
...
...
Lib/idlelib/run.py
Dosyayı görüntüle @
e7c8fdee
...
...
@@ -6,6 +6,7 @@ import traceback
import
_thread
as
thread
import
threading
import
queue
import
builtins
from
idlelib
import
CallTips
from
idlelib
import
AutoComplete
...
...
@@ -261,6 +262,25 @@ class MyRPCServer(rpc.RPCServer):
thread
.
interrupt_main
()
def
displayhook
(
value
):
"""Override standard display hook to use non-locale encoding"""
if
value
is
None
:
return
# Set '_' to None to avoid recursion
builtins
.
_
=
None
text
=
repr
(
value
)
try
:
sys
.
stdout
.
write
(
text
)
except
UnicodeEncodeError
:
# let's use ascii while utf8-bmp codec doesn't present
encoding
=
'ascii'
bytes
=
text
.
encode
(
encoding
,
'backslashreplace'
)
text
=
bytes
.
decode
(
encoding
,
'strict'
)
sys
.
stdout
.
write
(
text
)
sys
.
stdout
.
write
(
"
\n
"
)
builtins
.
_
=
value
class
MyHandler
(
rpc
.
RPCHandler
):
def
handle
(
self
):
...
...
@@ -270,6 +290,7 @@ class MyHandler(rpc.RPCHandler):
sys
.
stdin
=
self
.
console
=
self
.
get_remote_proxy
(
"stdin"
)
sys
.
stdout
=
self
.
get_remote_proxy
(
"stdout"
)
sys
.
stderr
=
self
.
get_remote_proxy
(
"stderr"
)
sys
.
displayhook
=
displayhook
# page help() text to shell.
import
pydoc
# import must be done here to capture i/o binding
pydoc
.
pager
=
pydoc
.
plainpager
...
...
Misc/NEWS
Dosyayı görüntüle @
e7c8fdee
...
...
@@ -24,6 +24,8 @@ Core and Builtins
Library
-------
-
Issue
#
14200
:
Idle
shell
crash
on
printing
non
-
BMP
unicode
character
.
-
Issue
#
12818
:
format
address
no
longer
needlessly
\
escapes
()
s
in
names
when
the
name
ends
up
being
quoted
.
...
...
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