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
452b3a6a
Kaydet (Commit)
452b3a6a
authored
Ara 12, 2016
tarafından
Xavier de Gaye
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28764: Fix a test_mailbox failure on Android API 24 when run as a non-root user.
üst
b227227c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
mailbox.py
Lib/mailbox.py
+12
-9
test_mailbox.py
Lib/test/test_mailbox.py
+2
-2
No files found.
Lib/mailbox.py
Dosyayı görüntüle @
452b3a6a
...
@@ -313,11 +313,12 @@ class Maildir(Mailbox):
...
@@ -313,11 +313,12 @@ class Maildir(Mailbox):
# final position in order to prevent race conditions with changes
# final position in order to prevent race conditions with changes
# from other programs
# from other programs
try
:
try
:
if
hasattr
(
os
,
'link'
)
:
try
:
os
.
link
(
tmp_file
.
name
,
dest
)
os
.
link
(
tmp_file
.
name
,
dest
)
os
.
remove
(
tmp_file
.
name
)
except
(
AttributeError
,
PermissionError
):
else
:
os
.
rename
(
tmp_file
.
name
,
dest
)
os
.
rename
(
tmp_file
.
name
,
dest
)
else
:
os
.
remove
(
tmp_file
.
name
)
except
OSError
as
e
:
except
OSError
as
e
:
os
.
remove
(
tmp_file
.
name
)
os
.
remove
(
tmp_file
.
name
)
if
e
.
errno
==
errno
.
EEXIST
:
if
e
.
errno
==
errno
.
EEXIST
:
...
@@ -1200,13 +1201,14 @@ class MH(Mailbox):
...
@@ -1200,13 +1201,14 @@ class MH(Mailbox):
for
key
in
self
.
iterkeys
():
for
key
in
self
.
iterkeys
():
if
key
-
1
!=
prev
:
if
key
-
1
!=
prev
:
changes
.
append
((
key
,
prev
+
1
))
changes
.
append
((
key
,
prev
+
1
))
if
hasattr
(
os
,
'link'
)
:
try
:
os
.
link
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
link
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
os
.
unlink
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)))
except
(
AttributeError
,
PermissionError
):
else
:
os
.
rename
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
rename
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)),
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
os
.
path
.
join
(
self
.
_path
,
str
(
prev
+
1
)))
else
:
os
.
unlink
(
os
.
path
.
join
(
self
.
_path
,
str
(
key
)))
prev
+=
1
prev
+=
1
self
.
_next_key
=
prev
+
1
self
.
_next_key
=
prev
+
1
if
len
(
changes
)
==
0
:
if
len
(
changes
)
==
0
:
...
@@ -2076,13 +2078,14 @@ def _lock_file(f, dotlock=True):
...
@@ -2076,13 +2078,14 @@ def _lock_file(f, dotlock=True):
else
:
else
:
raise
raise
try
:
try
:
if
hasattr
(
os
,
'link'
)
:
try
:
os
.
link
(
pre_lock
.
name
,
f
.
name
+
'.lock'
)
os
.
link
(
pre_lock
.
name
,
f
.
name
+
'.lock'
)
dotlock_done
=
True
dotlock_done
=
True
os
.
unlink
(
pre_lock
.
name
)
except
(
AttributeError
,
PermissionError
):
else
:
os
.
rename
(
pre_lock
.
name
,
f
.
name
+
'.lock'
)
os
.
rename
(
pre_lock
.
name
,
f
.
name
+
'.lock'
)
dotlock_done
=
True
dotlock_done
=
True
else
:
os
.
unlink
(
pre_lock
.
name
)
except
FileExistsError
:
except
FileExistsError
:
os
.
remove
(
pre_lock
.
name
)
os
.
remove
(
pre_lock
.
name
)
raise
ExternalClashError
(
'dot lock unavailable:
%
s'
%
raise
ExternalClashError
(
'dot lock unavailable:
%
s'
%
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
452b3a6a
...
@@ -2137,9 +2137,9 @@ class MaildirTestCase(unittest.TestCase):
...
@@ -2137,9 +2137,9 @@ class MaildirTestCase(unittest.TestCase):
if
mbox
:
if
mbox
:
fp
.
write
(
FROM_
)
fp
.
write
(
FROM_
)
fp
.
write
(
DUMMY_MESSAGE
)
fp
.
write
(
DUMMY_MESSAGE
)
if
hasattr
(
os
,
"link"
)
:
try
:
os
.
link
(
tmpname
,
newname
)
os
.
link
(
tmpname
,
newname
)
e
lse
:
e
xcept
(
AttributeError
,
PermissionError
)
:
with
open
(
newname
,
"w"
)
as
fp
:
with
open
(
newname
,
"w"
)
as
fp
:
fp
.
write
(
DUMMY_MESSAGE
)
fp
.
write
(
DUMMY_MESSAGE
)
self
.
_msgfiles
.
append
(
newname
)
self
.
_msgfiles
.
append
(
newname
)
...
...
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