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
0dac808b
Kaydet (Commit)
0dac808b
authored
Eyl 23, 2010
tarafından
Brian Curtin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix #9790: Rework the imports necessary for ntpath.samefile and
ntpath.sameopenfile.
üst
972412d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
ntpath.py
Lib/ntpath.py
+21
-16
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ntpath.py
Dosyayı görüntüle @
0dac808b
...
...
@@ -641,24 +641,29 @@ def relpath(path, start=curdir):
# determine if two files are in fact the same file
try
:
from
nt
import
_getfinalpathname
except
(
NotImplementedError
,
ImportError
):
# On Windows XP and earlier, two files are the same if their absolute
# pathnames are the same.
# Also, on other operating systems, fake this method with a
# Windows-XP approximation.
def
_getfinalpathname
(
f
):
return
abspath
(
f
)
def
samefile
(
f1
,
f2
):
"Test whether two pathnames reference the same actual file"
try
:
from
nt
import
_getfinalpathname
return
_getfinalpathname
(
f1
)
==
_getfinalpathname
(
f2
)
except
(
NotImplementedError
,
ImportError
):
# On Windows XP and earlier, two files are the same if their
# absolute pathnames are the same.
# Also, on other operating systems, fake this method with a
# Windows-XP approximation.
return
abspath
(
f1
)
==
abspath
(
f2
)
return
_getfinalpathname
(
f1
)
==
_getfinalpathname
(
f2
)
try
:
from
nt
import
_getfileinformation
except
ImportError
:
# On other operating systems, just return the fd and see that
# it compares equal in sameopenfile.
def
_getfileinformation
(
fd
):
return
fd
def
sameopenfile
(
f1
,
f2
):
"""Test whether two file objects reference the same file"""
try
:
from
nt
import
_getfileinformation
return
_getfileinformation
(
f1
)
==
_getfileinformation
(
f2
)
except
ImportError
:
# On other operating systems, return True if the file descriptors
# are the same.
return
f1
==
f2
return
_getfileinformation
(
f1
)
==
_getfileinformation
(
f2
)
Misc/NEWS
Dosyayı görüntüle @
0dac808b
...
...
@@ -68,6 +68,9 @@ Core and Builtins
Library
-------
- Issue #9790: Rework imports necessary for samefile and sameopenfile
in ntpath.
- Issue #9928: Properly initialize the types exported by the bz2 module.
- Issue #1675951: Allow GzipFile to work with unseekable file objects.
...
...
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