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
9ed707eb
Kaydet (Commit)
9ed707eb
authored
Ock 13, 2017
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #29197: Removed deprecated function ntpath.splitunc().
üst
4f76fb16
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
61 deletions
+9
-61
os.path.rst
Doc/library/os.path.rst
+0
-13
3.7.rst
Doc/whatsnew/3.7.rst
+4
-0
ntpath.py
Lib/ntpath.py
+1
-23
test_ntpath.py
Lib/test/test_ntpath.py
+1
-24
NEWS
Misc/NEWS
+3
-1
No files found.
Doc/library/os.path.rst
Dosyayı görüntüle @
9ed707eb
...
...
@@ -453,19 +453,6 @@ the :mod:`glob` module.)
Accepts a :term:`path-like object`.
.. function:: splitunc(path)
.. deprecated:: 3.1
Use *splitdrive* instead.
Split the pathname *path* into a pair ``(unc, rest)`` so that *unc* is the UNC
mount point (such as ``r'\\host\mount'``), if present, and *rest* the rest of
the path (such as ``r'\path\file.ext'``). For paths containing drive letters,
*unc* will always be the empty string.
Availability: Windows.
.. data:: supports_unicode_filenames
``True`` if arbitrary Unicode strings can be used as file names (within limitations
...
...
Doc/whatsnew/3.7.rst
Dosyayı görüntüle @
9ed707eb
...
...
@@ -142,6 +142,10 @@ API and Feature Removals
* Removed support of the *exclude* argument in :meth:`tarfile.TarFile.add`.
Use the *filter* argument instead.
* The ``splitunc()`` function in the :mod:`ntpath` module was deprecated in
Python 3.1, and has now been removed. Use the :func:`~os.path.splitdrive`
function instead.
Porting to Python 3.7
=====================
...
...
Lib/ntpath.py
Dosyayı görüntüle @
9ed707eb
...
...
@@ -15,7 +15,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename"
,
"dirname"
,
"commonprefix"
,
"getsize"
,
"getmtime"
,
"getatime"
,
"getctime"
,
"islink"
,
"exists"
,
"lexists"
,
"isdir"
,
"isfile"
,
"ismount"
,
"expanduser"
,
"expandvars"
,
"normpath"
,
"abspath"
,
"
splitunc"
,
"
curdir"
,
"pardir"
,
"sep"
,
"pathsep"
,
"defpath"
,
"altsep"
,
"curdir"
,
"pardir"
,
"sep"
,
"pathsep"
,
"defpath"
,
"altsep"
,
"extsep"
,
"devnull"
,
"realpath"
,
"supports_unicode_filenames"
,
"relpath"
,
"samefile"
,
"sameopenfile"
,
"samestat"
,
"commonpath"
]
...
...
@@ -169,28 +169,6 @@ def splitdrive(p):
return
p
[:
0
],
p
# Parse UNC paths
def
splitunc
(
p
):
"""Deprecated since Python 3.1. Please use splitdrive() instead;
it now handles UNC paths.
Split a pathname into UNC mount point and relative path specifiers.
Return a 2-tuple (unc, rest); either part may be empty.
If unc is not empty, it has the form '//host/mount' (or similar
using backslashes). unc+rest is always the input path.
Paths containing drive letters never have a UNC part.
"""
import
warnings
warnings
.
warn
(
"ntpath.splitunc is deprecated, use ntpath.splitdrive instead"
,
DeprecationWarning
,
2
)
drive
,
path
=
splitdrive
(
p
)
if
len
(
drive
)
==
2
:
# Drive letter present
return
p
[:
0
],
p
return
drive
,
path
# Split a path in head (everything up to the last '/') and tail (the
# rest). After the trailing '/' is stripped, the invariant
# join(head, tail) == p holds.
...
...
Lib/test/test_ntpath.py
Dosyayı görüntüle @
9ed707eb
...
...
@@ -72,29 +72,6 @@ class TestNtpath(unittest.TestCase):
self
.
assertEqual
(
ntpath
.
splitdrive
(
'//conky/MOUNTPOİNT/foo/bar'
),
(
'//conky/MOUNTPOİNT'
,
'/foo/bar'
))
def
test_splitunc
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
ntpath
.
splitunc
(
''
)
with
support
.
check_warnings
((
''
,
DeprecationWarning
)):
tester
(
'ntpath.splitunc("c:
\\
foo
\\
bar")'
,
(
''
,
'c:
\\
foo
\\
bar'
))
tester
(
'ntpath.splitunc("c:/foo/bar")'
,
(
''
,
'c:/foo/bar'
))
tester
(
'ntpath.splitunc("
\\\\
conky
\\
mountpoint
\\
foo
\\
bar")'
,
(
'
\\\\
conky
\\
mountpoint'
,
'
\\
foo
\\
bar'
))
tester
(
'ntpath.splitunc("//conky/mountpoint/foo/bar")'
,
(
'//conky/mountpoint'
,
'/foo/bar'
))
tester
(
'ntpath.splitunc("
\\\\\\
conky
\\
mountpoint
\\
foo
\\
bar")'
,
(
''
,
'
\\\\\\
conky
\\
mountpoint
\\
foo
\\
bar'
))
tester
(
'ntpath.splitunc("///conky/mountpoint/foo/bar")'
,
(
''
,
'///conky/mountpoint/foo/bar'
))
tester
(
'ntpath.splitunc("
\\\\
conky
\\\\
mountpoint
\\
foo
\\
bar")'
,
(
''
,
'
\\\\
conky
\\\\
mountpoint
\\
foo
\\
bar'
))
tester
(
'ntpath.splitunc("//conky//mountpoint/foo/bar")'
,
(
''
,
'//conky//mountpoint/foo/bar'
))
self
.
assertEqual
(
ntpath
.
splitunc
(
'//conky/MOUNTPOİNT/foo/bar'
),
(
'//conky/MOUNTPOİNT'
,
'/foo/bar'
))
def
test_split
(
self
):
tester
(
'ntpath.split("c:
\\
foo
\\
bar")'
,
(
'c:
\\
foo'
,
'bar'
))
tester
(
'ntpath.split("
\\\\
conky
\\
mountpoint
\\
foo
\\
bar")'
,
...
...
@@ -449,7 +426,7 @@ class TestNtpath(unittest.TestCase):
class
NtCommonTest
(
test_genericpath
.
CommonTest
,
unittest
.
TestCase
):
pathmodule
=
ntpath
attributes
=
[
'relpath'
,
'splitunc'
]
attributes
=
[
'relpath'
]
class
PathLikeTests
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
9ed707eb
...
...
@@ -212,7 +212,9 @@ Core and Builtins
Library
-------
-
Issue
#
29210
:
Removed
support
of
deprecated
argument
"exclude"
in
-
Issue
#
29197
:
Removed
deprecated
function
ntpath
.
splitunc
().
-
Issue
#
29210
:
Removed
support
of
deprecated
argument
"exclude"
in
tarfile
.
TarFile
.
add
().
-
Issue
#
29219
:
Fixed
infinite
recursion
in
the
repr
of
uninitialized
...
...
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