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
830358af
Kaydet (Commit)
830358af
authored
Kas 17, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove locking of individual message files in MH.pack().
[Backport of rev52776 from the trunk.]
üst
dd3bffb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
mailbox.py
Lib/mailbox.py
+7
-21
test_mailbox.py
Lib/test/test_mailbox.py
+15
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/mailbox.py
Dosyayı görüntüle @
830358af
...
...
@@ -1054,27 +1054,13 @@ class MH(Mailbox):
for
key
in
self
.
iterkeys
():
if
key
-
1
!=
prev
:
changes
.
append
((
key
,
prev
+
1
))
f
=
open
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
'r+'
)
try
:
if
self
.
_locked
:
_lock_file
(
f
)
try
:
if
hasattr
(
os
,
'link'
):
os
.
link
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
if
sys
.
platform
==
'os2emx'
:
# cannot unlink an open file on OS/2
f
.
close
()
os
.
unlink
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)))
else
:
f
.
close
()
os
.
rename
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
finally
:
if
self
.
_locked
:
_unlock_file
(
f
)
finally
:
f
.
close
()
if
hasattr
(
os
,
'link'
):
os
.
link
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
os
.
unlink
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)))
else
:
os
.
rename
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
prev
+=
1
self
.
_next_key
=
prev
+
1
if
len
(
changes
)
==
0
:
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
830358af
...
...
@@ -887,6 +887,21 @@ class TestMH(TestMailbox):
self
.
assert_
(
self
.
_box
.
get_sequences
()
==
{
'foo'
:[
1
,
2
,
3
],
'unseen'
:[
1
],
'bar'
:[
3
],
'replied'
:[
3
]})
# Test case for packing while holding the mailbox locked.
key0
=
self
.
_box
.
add
(
msg1
)
key1
=
self
.
_box
.
add
(
msg1
)
key2
=
self
.
_box
.
add
(
msg1
)
key3
=
self
.
_box
.
add
(
msg1
)
self
.
_box
.
remove
(
key0
)
self
.
_box
.
remove
(
key2
)
self
.
_box
.
lock
()
self
.
_box
.
pack
()
self
.
_box
.
unlock
()
self
.
assert_
(
self
.
_box
.
get_sequences
()
==
{
'foo'
:[
1
,
2
,
3
,
4
,
5
],
'unseen'
:[
1
],
'bar'
:[
3
],
'replied'
:[
3
]})
def
_get_lock_path
(
self
):
return
os
.
path
.
join
(
self
.
_path
,
'.mh_sequences.lock'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
830358af
...
...
@@ -158,6 +158,10 @@ Library
been physically written to disk after calling .flush() or
.close(). (Patch by David Watson.)
- mailbox.py: Change MH.pack() to not lock individual message files; this
wasn'
t
consistent
with
existing
implementations
of
message
packing
,
and
was
buggy
on
some
platforms
.
-
Bug
#
1576241
:
fix
functools
.
wraps
()
to
work
on
built
-
in
functions
.
-
Patch
#
1574068
:
fix
urllib
/
urllib2
to
not
insert
line
breaks
when
...
...
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