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
d0f6e0a6
Kaydet (Commit)
d0f6e0a6
authored
Haz 29, 2012
tarafından
Hynek Schlawack
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Check for all used fd-based functions in shutil.rmdir, closes #15218
üst
0b50bf3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
shutil.py
Lib/shutil.py
+4
-2
test_shutil.py
Lib/test/test_shutil.py
+5
-1
No files found.
Lib/shutil.py
Dosyayı görüntüle @
d0f6e0a6
...
...
@@ -405,8 +405,10 @@ def _rmtree_safe_fd(topfd, path, onerror):
except
os
.
error
:
onerror
(
os
.
unlink
,
fullname
,
sys
.
exc_info
())
_use_fd_functions
=
(
os
.
unlink
in
os
.
supports_dir_fd
and
os
.
open
in
os
.
supports_dir_fd
)
_use_fd_functions
=
({
os
.
open
,
os
.
stat
,
os
.
unlink
,
os
.
rmdir
}
<=
os
.
supports_dir_fd
and
os
.
listdir
in
os
.
supports_fd
and
os
.
stat
in
os
.
supports_follow_symlinks
)
def
rmtree
(
path
,
ignore_errors
=
False
,
onerror
=
None
):
"""Recursively delete a directory tree.
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
d0f6e0a6
...
...
@@ -524,7 +524,11 @@ class TestShutil(unittest.TestCase):
self
.
assertFalse
(
os
.
path
.
islink
(
dst
))
def
test_rmtree_uses_safe_fd_version_if_available
(
self
):
if
os
.
unlink
in
os
.
supports_dir_fd
and
os
.
open
in
os
.
supports_dir_fd
:
_use_fd_functions
=
({
os
.
open
,
os
.
stat
,
os
.
unlink
,
os
.
rmdir
}
<=
os
.
supports_dir_fd
and
os
.
listdir
in
os
.
supports_fd
and
os
.
stat
in
os
.
supports_follow_symlinks
)
if
_use_fd_functions
:
self
.
assertTrue
(
shutil
.
_use_fd_functions
)
self
.
assertTrue
(
shutil
.
rmtree
.
avoids_symlink_attacks
)
tmp_dir
=
self
.
mkdtemp
()
...
...
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