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
69ab5836
Kaydet (Commit)
69ab5836
authored
Kas 18, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Paul Rubin reminds me that of course a class's constructor /could/ get
called, if the pickler found a __getinitargs__() method.
üst
f376ef09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
libpickle.tex
Doc/lib/libpickle.tex
+6
-4
No files found.
Doc/lib/libpickle.tex
Dosyayı görüntüle @
69ab5836
...
...
@@ -604,10 +604,12 @@ evil things like call \code{os.unlink()} with an arbitrary file name.
See section~
\ref
{
pickle-protocol
}
for more details.
For safely unpickling class instances, you need to control exactly
which classes will get created. The issue here is usually not that a
class's constructor will get called --- it won't by the unpickler ---
but that the class's destructor (i.e. its
\method
{__
del
__
()
}
method)
might get called when the object is garbage collected. The way to
which classes will get created. Be aware that a class's constructor
could be called (if the pickler found a
\method
{__
getinitargs
__
()
}
method) and the the class's destructor (i.e. its
\method
{__
del
__
()
}
method)
might get called when the object is garbage collected. Depending on
the class, it isn't very heard to trick either method into doing bad
things, such as removing a file. The way to
control the classes that are safe to instantiate differs in
\module
{
pickle
}
and
\module
{
cPickle
}
\footnote
{
A word of caution: the
mechanisms described here use internal attributes and methods, which
...
...
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