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
acfc26ac
Kaydet (Commit)
acfc26ac
authored
May 15, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge heads
üst
b26fe2f3
66bfcc1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
os.py
Lib/os.py
+17
-7
test_os.py
Lib/test/test_os.py
+5
-1
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/os.py
Dosyayı görüntüle @
acfc26ac
...
@@ -353,13 +353,23 @@ if _exists("openat"):
...
@@ -353,13 +353,23 @@ if _exists("openat"):
names
=
flistdir
(
topfd
)
names
=
flistdir
(
topfd
)
dirs
,
nondirs
=
[],
[]
dirs
,
nondirs
=
[],
[]
for
name
in
names
:
for
name
in
names
:
# Here, we don't use AT_SYMLINK_NOFOLLOW to be consistent with
try
:
# walk() which reports symlinks to directories as directories. We do
# Here, we don't use AT_SYMLINK_NOFOLLOW to be consistent with
# however check for symlinks before recursing into a subdirectory.
# walk() which reports symlinks to directories as directories.
if
st
.
S_ISDIR
(
fstatat
(
topfd
,
name
)
.
st_mode
):
# We do however check for symlinks before recursing into
dirs
.
append
(
name
)
# a subdirectory.
else
:
if
st
.
S_ISDIR
(
fstatat
(
topfd
,
name
)
.
st_mode
):
nondirs
.
append
(
name
)
dirs
.
append
(
name
)
else
:
nondirs
.
append
(
name
)
except
FileNotFoundError
:
try
:
# Add dangling symlinks, ignore disappeared files
if
st
.
S_ISLNK
(
fstatat
(
topfd
,
name
,
AT_SYMLINK_NOFOLLOW
)
.
st_mode
):
nondirs
.
append
(
name
)
except
FileNotFoundError
:
continue
if
topdown
:
if
topdown
:
yield
toppath
,
dirs
,
nondirs
,
topfd
yield
toppath
,
dirs
,
nondirs
,
topfd
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
acfc26ac
...
@@ -651,6 +651,7 @@ class WalkTests(unittest.TestCase):
...
@@ -651,6 +651,7 @@ class WalkTests(unittest.TestCase):
# SUB2/ a file kid and a dirsymlink kid
# SUB2/ a file kid and a dirsymlink kid
# tmp3
# tmp3
# link/ a symlink to TESTFN.2
# link/ a symlink to TESTFN.2
# broken_link
# TEST2/
# TEST2/
# tmp4 a lone file
# tmp4 a lone file
walk_path
=
join
(
support
.
TESTFN
,
"TEST1"
)
walk_path
=
join
(
support
.
TESTFN
,
"TEST1"
)
...
@@ -663,6 +664,8 @@ class WalkTests(unittest.TestCase):
...
@@ -663,6 +664,8 @@ class WalkTests(unittest.TestCase):
link_path
=
join
(
sub2_path
,
"link"
)
link_path
=
join
(
sub2_path
,
"link"
)
t2_path
=
join
(
support
.
TESTFN
,
"TEST2"
)
t2_path
=
join
(
support
.
TESTFN
,
"TEST2"
)
tmp4_path
=
join
(
support
.
TESTFN
,
"TEST2"
,
"tmp4"
)
tmp4_path
=
join
(
support
.
TESTFN
,
"TEST2"
,
"tmp4"
)
link_path
=
join
(
sub2_path
,
"link"
)
broken_link_path
=
join
(
sub2_path
,
"broken_link"
)
# Create stuff.
# Create stuff.
os
.
makedirs
(
sub11_path
)
os
.
makedirs
(
sub11_path
)
...
@@ -679,7 +682,8 @@ class WalkTests(unittest.TestCase):
...
@@ -679,7 +682,8 @@ class WalkTests(unittest.TestCase):
else
:
else
:
symlink_to_dir
=
os
.
symlink
symlink_to_dir
=
os
.
symlink
symlink_to_dir
(
os
.
path
.
abspath
(
t2_path
),
link_path
)
symlink_to_dir
(
os
.
path
.
abspath
(
t2_path
),
link_path
)
sub2_tree
=
(
sub2_path
,
[
"link"
],
[
"tmp3"
])
symlink_to_dir
(
'broken'
,
broken_link_path
)
sub2_tree
=
(
sub2_path
,
[
"link"
],
[
"broken_link"
,
"tmp3"
])
else
:
else
:
sub2_tree
=
(
sub2_path
,
[],
[
"tmp3"
])
sub2_tree
=
(
sub2_path
,
[],
[
"tmp3"
])
...
...
Misc/NEWS
Dosyayı görüntüle @
acfc26ac
...
@@ -31,6 +31,8 @@ Core and Builtins
...
@@ -31,6 +31,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue 14773: Fix os.fwalk() failing on dangling symlinks.
- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
Authentation in urllib2.
Authentation in urllib2.
...
...
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