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
cc757172
Kaydet (Commit)
cc757172
authored
Nis 14, 2013
tarafından
Alexandre Vassalotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Style cleanups for pickle.py and _pickle.
üst
f36f20f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
pickle.py
Lib/pickle.py
+7
-5
_pickle.c
Modules/_pickle.c
+2
-4
No files found.
Lib/pickle.py
Dosyayı görüntüle @
cc757172
...
...
@@ -933,7 +933,7 @@ class _Unpickler:
n
=
mloads
(
b
'i'
+
self
.
read
(
4
))
if
n
<
0
:
# Corrupt or hostile pickle -- we never write one like this
raise
UnpicklingError
(
"LONG pickle has negative byte count"
)
;
raise
UnpicklingError
(
"LONG pickle has negative byte count"
)
data
=
self
.
read
(
n
)
self
.
append
(
decode_long
(
data
))
dispatch
[
LONG4
[
0
]]
=
load_long4
...
...
@@ -965,7 +965,7 @@ class _Unpickler:
# Deprecated BINSTRING uses signed 32-bit length
len
=
mloads
(
b
'i'
+
self
.
read
(
4
))
if
len
<
0
:
raise
UnpicklingError
(
"BINSTRING pickle has negative byte count"
)
;
raise
UnpicklingError
(
"BINSTRING pickle has negative byte count"
)
data
=
self
.
read
(
len
)
value
=
str
(
data
,
self
.
encoding
,
self
.
errors
)
self
.
append
(
value
)
...
...
@@ -974,7 +974,8 @@ class _Unpickler:
def
load_binbytes
(
self
,
unpack
=
struct
.
unpack
,
maxsize
=
sys
.
maxsize
):
len
,
=
unpack
(
'<I'
,
self
.
read
(
4
))
if
len
>
maxsize
:
raise
UnpicklingError
(
"BINBYTES exceeds system's maximum size of
%
d bytes"
%
maxsize
);
raise
UnpicklingError
(
"BINBYTES exceeds system's maximum size "
"of
%
d bytes"
%
maxsize
)
self
.
append
(
self
.
read
(
len
))
dispatch
[
BINBYTES
[
0
]]
=
load_binbytes
...
...
@@ -985,7 +986,8 @@ class _Unpickler:
def
load_binunicode
(
self
,
unpack
=
struct
.
unpack
,
maxsize
=
sys
.
maxsize
):
len
,
=
unpack
(
'<I'
,
self
.
read
(
4
))
if
len
>
maxsize
:
raise
UnpicklingError
(
"BINUNICODE exceeds system's maximum size of
%
d bytes"
%
maxsize
);
raise
UnpicklingError
(
"BINUNICODE exceeds system's maximum size "
"of
%
d bytes"
%
maxsize
)
self
.
append
(
str
(
self
.
read
(
len
),
'utf-8'
,
'surrogatepass'
))
dispatch
[
BINUNICODE
[
0
]]
=
load_binunicode
...
...
@@ -1118,7 +1120,7 @@ class _Unpickler:
if
not
key
:
if
code
<=
0
:
# note that 0 is forbidden
# Corrupt or hostile pickle.
raise
UnpicklingError
(
"EXT specifies code <= 0"
)
;
raise
UnpicklingError
(
"EXT specifies code <= 0"
)
raise
ValueError
(
"unregistered extension code
%
d"
%
code
)
obj
=
self
.
find_class
(
*
key
)
_extension_cache
[
code
]
=
obj
...
...
Modules/_pickle.c
Dosyayı görüntüle @
cc757172
...
...
@@ -4260,8 +4260,7 @@ load_binbytes(UnpicklerObject *self)
if
(
x
<
0
)
{
PyErr_Format
(
PyExc_OverflowError
,
"BINBYTES exceeds system's maximum size of %zd bytes"
,
PY_SSIZE_T_MAX
);
PY_SSIZE_T_MAX
);
return
-
1
;
}
...
...
@@ -4385,8 +4384,7 @@ load_binunicode(UnpicklerObject *self)
if
(
size
<
0
)
{
PyErr_Format
(
PyExc_OverflowError
,
"BINUNICODE exceeds system's maximum size of %zd bytes"
,
PY_SSIZE_T_MAX
);
PY_SSIZE_T_MAX
);
return
-
1
;
}
...
...
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