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
af4e4747
Kaydet (Commit)
af4e4747
authored
Eki 25, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #28353: os.fwalk() no longer fails on broken links.
üst
179111bd
42bababb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
os.py
Lib/os.py
+2
-2
test_os.py
Lib/test/test_os.py
+18
-2
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/os.py
Dosyayı görüntüle @
af4e4747
...
...
@@ -481,13 +481,13 @@ if {open, stat} <= supports_dir_fd and {listdir, stat} <= supports_fd:
dirs
.
append
(
name
)
else
:
nondirs
.
append
(
name
)
except
FileNotFound
Error
:
except
OS
Error
:
try
:
# Add dangling symlinks, ignore disappeared files
if
st
.
S_ISLNK
(
stat
(
name
,
dir_fd
=
topfd
,
follow_symlinks
=
False
)
.
st_mode
):
nondirs
.
append
(
name
)
except
FileNotFound
Error
:
except
OS
Error
:
continue
if
topdown
:
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
af4e4747
...
...
@@ -853,38 +853,54 @@ class WalkTests(unittest.TestCase):
# SUB11/ no kids
# SUB2/ a file kid and a dirsymlink kid
# tmp3
# SUB21/ not readable
# tmp5
# link/ a symlink to TESTFN.2
# broken_link
# broken_link2
# broken_link3
# TEST2/
# tmp4 a lone file
self
.
walk_path
=
join
(
support
.
TESTFN
,
"TEST1"
)
self
.
sub1_path
=
join
(
self
.
walk_path
,
"SUB1"
)
self
.
sub11_path
=
join
(
self
.
sub1_path
,
"SUB11"
)
sub2_path
=
join
(
self
.
walk_path
,
"SUB2"
)
sub21_path
=
join
(
sub2_path
,
"SUB21"
)
tmp1_path
=
join
(
self
.
walk_path
,
"tmp1"
)
tmp2_path
=
join
(
self
.
sub1_path
,
"tmp2"
)
tmp3_path
=
join
(
sub2_path
,
"tmp3"
)
tmp5_path
=
join
(
sub21_path
,
"tmp3"
)
self
.
link_path
=
join
(
sub2_path
,
"link"
)
t2_path
=
join
(
support
.
TESTFN
,
"TEST2"
)
tmp4_path
=
join
(
support
.
TESTFN
,
"TEST2"
,
"tmp4"
)
broken_link_path
=
join
(
sub2_path
,
"broken_link"
)
broken_link2_path
=
join
(
sub2_path
,
"broken_link2"
)
broken_link3_path
=
join
(
sub2_path
,
"broken_link3"
)
# Create stuff.
os
.
makedirs
(
self
.
sub11_path
)
os
.
makedirs
(
sub2_path
)
os
.
makedirs
(
sub21_path
)
os
.
makedirs
(
t2_path
)
for
path
in
tmp1_path
,
tmp2_path
,
tmp3_path
,
tmp4_path
:
for
path
in
tmp1_path
,
tmp2_path
,
tmp3_path
,
tmp4_path
,
tmp5_path
:
with
open
(
path
,
"x"
)
as
f
:
f
.
write
(
"I'm "
+
path
+
" and proud of it. Blame test_os.
\n
"
)
if
support
.
can_symlink
():
os
.
symlink
(
os
.
path
.
abspath
(
t2_path
),
self
.
link_path
)
os
.
symlink
(
'broken'
,
broken_link_path
,
True
)
self
.
sub2_tree
=
(
sub2_path
,
[
"link"
],
[
"broken_link"
,
"tmp3"
])
os
.
symlink
(
join
(
'tmp3'
,
'broken'
),
broken_link2_path
,
True
)
os
.
symlink
(
join
(
'SUB21'
,
'tmp5'
),
broken_link3_path
,
True
)
self
.
sub2_tree
=
(
sub2_path
,
[
"link"
,
"SUB21"
],
[
"broken_link"
,
"broken_link2"
,
"broken_link3"
,
"tmp3"
])
else
:
self
.
sub2_tree
=
(
sub2_path
,
[],
[
"tmp3"
])
os
.
chmod
(
sub21_path
,
0
)
self
.
addCleanup
(
os
.
chmod
,
sub21_path
,
stat
.
S_IRWXU
)
def
test_walk_topdown
(
self
):
# Walk top-down.
all
=
list
(
self
.
walk
(
self
.
walk_path
))
...
...
Misc/NEWS
Dosyayı görüntüle @
af4e4747
...
...
@@ -29,6 +29,8 @@ Core and Builtins
Library
-------
- Issue #28353: os.fwalk() no longer fails on broken links.
- Issue #28430: Fix iterator of C implemented asyncio.Future doesn't accept
non-None value is passed to it.send(val).
...
...
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