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
1d8d729a
Kaydet (Commit)
1d8d729a
authored
Tem 13, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More comments about why not closing a dumddbm properly can be a disaster.
üst
4a6302b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
dumbdbm.py
Lib/dumbdbm.py
+7
-3
No files found.
Lib/dumbdbm.py
Dosyayı görüntüle @
1d8d729a
...
@@ -128,8 +128,8 @@ class _Database(UserDict.DictMixin):
...
@@ -128,8 +128,8 @@ class _Database(UserDict.DictMixin):
return
(
pos
,
len
(
val
))
return
(
pos
,
len
(
val
))
# key is a new key whose associated value starts in the data file
# key is a new key whose associated value starts in the data file
# at offset pos and with length siz
e
. Add an index record to
# at offset pos and with length siz. Add an index record to
# the in-memory index dict, and append one to the
index
file.
# the in-memory index dict, and append one to the
directory
file.
def
_addkey
(
self
,
key
,
pos_and_siz_pair
):
def
_addkey
(
self
,
key
,
pos_and_siz_pair
):
self
.
_index
[
key
]
=
pos_and_siz_pair
self
.
_index
[
key
]
=
pos_and_siz_pair
f
=
_open
(
self
.
_dirfile
,
'a'
,
self
.
_mode
)
f
=
_open
(
self
.
_dirfile
,
'a'
,
self
.
_mode
)
...
@@ -157,7 +157,11 @@ class _Database(UserDict.DictMixin):
...
@@ -157,7 +157,11 @@ class _Database(UserDict.DictMixin):
# Note that _index may be out of synch with the directory
# Note that _index may be out of synch with the directory
# file now: _setval() and _addval() don't update the directory
# file now: _setval() and _addval() don't update the directory
# file.
# file. This also means that the on-disk directory and data
# files are in a mutually inconsistent state, and they'll
# remain that way until _commit() is called. Note that this
# is a disaster (for the database) if the program crashes
# (so that _commit() never gets called).
def
__delitem__
(
self
,
key
):
def
__delitem__
(
self
,
key
):
# The blocks used by the associated value are lost.
# The blocks used by the associated value are lost.
...
...
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