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
0893a0a9
Kaydet (Commit)
0893a0a9
authored
May 09, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add Py3k warnings to os.path.walk
üst
9ec4aa01
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
6 deletions
+23
-6
os.path.rst
Doc/library/os.path.rst
+3
-3
macpath.py
Lib/macpath.py
+2
-1
ntpath.py
Lib/ntpath.py
+3
-1
posixpath.py
Lib/posixpath.py
+2
-1
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+11
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/os.path.rst
Dosyayı görüntüle @
0893a0a9
...
...
@@ -303,10 +303,10 @@ write files see :func:`open`, and for accessing the filesystem see the
identify them with ``os.path.islink(file)`` and ``os.path.isdir(file)``, and
invoke :func:`walk` as necessary.
..
note
::
..
warning
::
Th
e newer :func:`os.walk` :term:`generator` supplies similar functionality
and can be easier to use
.
Th
is function is deprecated and is removed in 3.0 in favor of
:func:`os.walk`
.
.. data:: supports_unicode_filenames
...
...
Lib/macpath.py
Dosyayı görüntüle @
0893a0a9
"""Pathname and path-related operations for the Macintosh."""
import
os
import
warnings
from
stat
import
*
import
genericpath
from
genericpath
import
*
...
...
@@ -169,7 +170,7 @@ def walk(top, func, arg):
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
warnings
.
warnpy3k
(
"In 3.x, os.path.walk is removed in favor of os.walk."
)
try
:
names
=
os
.
listdir
(
top
)
except
os
.
error
:
...
...
Lib/ntpath.py
Dosyayı görüntüle @
0893a0a9
...
...
@@ -9,6 +9,8 @@ import os
import
sys
import
stat
import
genericpath
import
warnings
from
genericpath
import
*
__all__
=
[
"normcase"
,
"isabs"
,
"join"
,
"splitdrive"
,
"split"
,
"splitext"
,
...
...
@@ -248,7 +250,7 @@ def walk(top, func, arg):
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
warnings
.
warnpy3k
(
"In 3.x, os.path.walk is removed in favor of os.walk."
)
try
:
names
=
os
.
listdir
(
top
)
except
os
.
error
:
...
...
Lib/posixpath.py
Dosyayı görüntüle @
0893a0a9
...
...
@@ -13,6 +13,7 @@ for manipulation of the pathname component of URLs.
import
os
import
stat
import
genericpath
import
warnings
from
genericpath
import
*
__all__
=
[
"normcase"
,
"isabs"
,
"join"
,
"splitdrive"
,
"split"
,
"splitext"
,
...
...
@@ -215,7 +216,7 @@ def walk(top, func, arg):
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
warnings
.
warnpy3k
(
"In 3.x, os.path.walk is removed in favor of os.walk."
)
try
:
names
=
os
.
listdir
(
top
)
except
os
.
error
:
...
...
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
0893a0a9
...
...
@@ -157,6 +157,17 @@ class TestStdlibRemovals(unittest.TestCase):
for
module_name
in
self
.
all_platforms
:
self
.
check_removal
(
module_name
)
def
test_os_path_walk
(
self
):
msg
=
"In 3.x, os.path.walk is removed in favor of os.walk."
def
dumbo
(
where
,
names
,
args
):
pass
for
path_mod
in
(
"ntpath"
,
"macpath"
,
"os2emxpath"
,
"posixpath"
):
mod
=
__import__
(
path_mod
)
with
catch_warning
()
as
w
:
# Since os3exmpath just imports it from ntpath
warnings
.
simplefilter
(
"always"
)
mod
.
walk
(
"."
,
dumbo
,
None
)
self
.
assertEquals
(
str
(
w
.
message
),
msg
)
def
test_main
():
run_unittest
(
TestPy3KWarnings
,
TestStdlibRemovals
)
...
...
Misc/NEWS
Dosyayı görüntüle @
0893a0a9
...
...
@@ -30,6 +30,8 @@ Library
- test.test_support.catch_warning() gained a 'record' argument.
- os.path.walk is deprecated in favor of os.walk.
Build
-----
...
...
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