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
1f9d907c
Kaydet (Commit)
1f9d907c
authored
Agu 15, 2008
tarafından
Alexandre Vassalotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 3514: Fixed segfault dues to infinite loop in __getattr__.
üst
e1e48ea2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
pickletester.py
Lib/test/pickletester.py
+12
-0
_pickle.c
Modules/_pickle.c
+5
-2
No files found.
Lib/test/pickletester.py
Dosyayı görüntüle @
1f9d907c
...
...
@@ -868,6 +868,14 @@ class AbstractPickleTests(unittest.TestCase):
y
=
self
.
loads
(
s
)
self
.
assertEqual
(
y
.
_reduce_called
,
1
)
def
test_bad_getattr
(
self
):
x
=
BadGetattr
()
for
proto
in
0
,
1
:
self
.
assertRaises
(
RuntimeError
,
self
.
dumps
,
x
,
proto
)
# protocol 2 don't raise a RuntimeError.
d
=
self
.
dumps
(
x
,
2
)
self
.
assertRaises
(
RuntimeError
,
self
.
loads
,
d
)
# Test classes for reduce_ex
class
REX_one
(
object
):
...
...
@@ -949,6 +957,10 @@ class SimpleNewObj(object):
# raise an error, to make sure this isn't called
raise
TypeError
(
"SimpleNewObj.__init__() didn't expect to get called"
)
class
BadGetattr
:
def
__getattr__
(
self
,
key
):
self
.
foo
class
AbstractPickleModuleTests
(
unittest
.
TestCase
):
def
test_dump_closed_file
(
self
):
...
...
Modules/_pickle.c
Dosyayı görüntüle @
1f9d907c
...
...
@@ -3834,8 +3834,11 @@ load_build(UnpicklerObject *self)
inst
=
self
->
stack
->
data
[
self
->
stack
->
length
-
1
];
setstate
=
PyObject_GetAttrString
(
inst
,
"__setstate__"
);
if
(
setstate
==
NULL
&&
PyErr_ExceptionMatches
(
PyExc_AttributeError
))
{
PyErr_Clear
();
if
(
setstate
==
NULL
)
{
if
(
PyErr_ExceptionMatches
(
PyExc_AttributeError
))
PyErr_Clear
();
else
return
-
1
;
}
else
{
PyObject
*
result
;
...
...
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