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
ad0c57fe
Kaydet (Commit)
ad0c57fe
authored
Eki 10, 2014
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21986: Idle now matches interpreter in not pickling user code objects.
Patch by Claudiu Popa
üst
9086f926
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
rpc.py
Lib/idlelib/rpc.py
+10
-10
No files found.
Lib/idlelib/rpc.py
Dosyayı görüntüle @
ad0c57fe
...
...
@@ -29,6 +29,7 @@ accomplished in Idle.
import
sys
import
os
import
io
import
socket
import
select
import
socketserver
...
...
@@ -53,16 +54,15 @@ def pickle_code(co):
ms
=
marshal
.
dumps
(
co
)
return
unpickle_code
,
(
ms
,)
# XXX KBK 24Aug02 function pickling capability not used in Idle
# def unpickle_function(ms):
# return ms
def
dumps
(
obj
,
protocol
=
None
):
f
=
io
.
BytesIO
()
p
=
CodePickler
(
f
,
protocol
)
p
.
dump
(
obj
)
return
f
.
getvalue
()
# def pickle_function(fn):
# assert isinstance(fn, type.FunctionType)
# return repr(fn)
copyreg
.
pickle
(
types
.
CodeType
,
pickle_code
,
unpickle_code
)
# copyreg.pickle(types.FunctionType, pickle_function, unpickle_function)
class
CodePickler
(
pickle
.
Pickler
):
dispatch_table
=
{
types
.
CodeType
:
pickle_code
}
dispatch_table
.
update
(
copyreg
.
dispatch_table
)
BUFSIZE
=
8
*
1024
LOCALHOST
=
'127.0.0.1'
...
...
@@ -329,7 +329,7 @@ class SocketIO(object):
def
putmessage
(
self
,
message
):
self
.
debug
(
"putmessage:
%
d:"
%
message
[
0
])
try
:
s
=
pickle
.
dumps
(
message
)
s
=
dumps
(
message
)
except
pickle
.
PicklingError
:
print
(
"Cannot pickle:"
,
repr
(
message
),
file
=
sys
.
__stderr__
)
raise
...
...
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