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
25652884
Kaydet (Commit)
25652884
authored
Haz 29, 2012
tarafından
Petri Lehtinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on flush()
üst
31a78c3d
5b5619f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
mailbox.py
Lib/mailbox.py
+3
-0
test_mailbox.py
Lib/test/test_mailbox.py
+17
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/mailbox.py
Dosyayı görüntüle @
25652884
...
@@ -691,6 +691,9 @@ class _singlefileMailbox(Mailbox):
...
@@ -691,6 +691,9 @@ class _singlefileMailbox(Mailbox):
_sync_close
(
new_file
)
_sync_close
(
new_file
)
# self._file is about to get replaced, so no need to sync.
# self._file is about to get replaced, so no need to sync.
self
.
_file
.
close
()
self
.
_file
.
close
()
# Make sure the new file's mode is the same as the old file's
mode
=
os
.
stat
(
self
.
_path
)
.
st_mode
os
.
chmod
(
new_file
.
name
,
mode
)
try
:
try
:
os
.
rename
(
new_file
.
name
,
self
.
_path
)
os
.
rename
(
new_file
.
name
,
self
.
_path
)
except
OSError
as
e
:
except
OSError
as
e
:
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
25652884
...
@@ -969,6 +969,23 @@ class _TestSingleFile(TestMailbox):
...
@@ -969,6 +969,23 @@ class _TestSingleFile(TestMailbox):
self
.
_box
=
self
.
_factory
(
self
.
_path
)
self
.
_box
=
self
.
_factory
(
self
.
_path
)
self
.
assertEqual
(
len
(
self
.
_box
),
1
)
self
.
assertEqual
(
len
(
self
.
_box
),
1
)
def
test_permissions_after_flush
(
self
):
# See issue #5346
# Make the mailbox world writable. It's unlikely that the new
# mailbox file would have these permissions after flush(),
# because umask usually prevents it.
mode
=
os
.
stat
(
self
.
_path
)
.
st_mode
|
0
o666
os
.
chmod
(
self
.
_path
,
mode
)
self
.
_box
.
add
(
self
.
_template
%
0
)
i
=
self
.
_box
.
add
(
self
.
_template
%
1
)
# Need to remove one message to make flush() create a new file
self
.
_box
.
remove
(
i
)
self
.
_box
.
flush
()
self
.
assertEqual
(
os
.
stat
(
self
.
_path
)
.
st_mode
,
mode
)
class
_TestMboxMMDF
(
_TestSingleFile
):
class
_TestMboxMMDF
(
_TestSingleFile
):
...
...
Misc/NEWS
Dosyayı görüntüle @
25652884
...
@@ -14,6 +14,9 @@ Core and Builtins
...
@@ -14,6 +14,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox
files on flush().
- Issue #10571: Fix the "--sign" option of distutils'
upload
command
.
- Issue #10571: Fix the "--sign" option of distutils'
upload
command
.
Patch
by
Jakub
Wilk
.
Patch
by
Jakub
Wilk
.
...
...
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