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
adb351fc
Kaydet (Commit)
adb351fc
authored
Mar 07, 2015
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #20876: correctly close temporary file in test.support.fs_is_case_insensitive()
üst
88f64f39
e3207fe8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
__init__.py
Lib/test/support/__init__.py
+9
-10
No files found.
Lib/test/support/__init__.py
Dosyayı görüntüle @
adb351fc
...
...
@@ -2134,16 +2134,15 @@ def skip_unless_xattr(test):
def
fs_is_case_insensitive
(
directory
):
"""Detects if the file system for the specified directory is case-insensitive."""
base_fp
,
base_path
=
tempfile
.
mkstemp
(
dir
=
directory
)
case_path
=
base_path
.
upper
()
if
case_path
==
base_path
:
case_path
=
base_path
.
lower
()
try
:
return
os
.
path
.
samefile
(
base_path
,
case_path
)
except
FileNotFoundError
:
return
False
finally
:
os
.
unlink
(
base_path
)
with
tempfile
.
NamedTemporaryFile
(
dir
=
directory
)
as
base
:
base_path
=
base
.
name
case_path
=
base_path
.
upper
()
if
case_path
==
base_path
:
case_path
=
base_path
.
lower
()
try
:
return
os
.
path
.
samefile
(
base_path
,
case_path
)
except
FileNotFoundError
:
return
False
class
SuppressCrashReport
:
...
...
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