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
9a45a6b1
Kaydet (Commit)
9a45a6b1
authored
Haz 11, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #8965: Write more tests for sys.getfilesystemencoding()
üst
19e65a35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
test_sys.py
Lib/test/test_sys.py
+24
-11
No files found.
Lib/test/test_sys.py
Dosyayı görüntüle @
9a45a6b1
...
...
@@ -863,21 +863,34 @@ class SizeofTest(unittest.TestCase):
# sys.flags
check
(
sys
.
flags
,
size
(
vh
)
+
self
.
P
*
len
(
sys
.
flags
))
@unittest.skipUnless
(
sys
.
platform
==
'darwin'
,
"test specific to Mac OS X"
)
def
test_getfilesystemencoding
(
self
):
# On Darwing FS encoding is always UTF-8
import
codecs
def
check_fsencoding
(
fs_encoding
):
self
.
assertIsNotNone
(
fs_encoding
)
if
sys
.
platform
==
'darwin'
:
self
.
assertEqual
(
fs_encoding
,
'utf-8'
)
codecs
.
lookup
(
fs_encoding
)
fs_encoding
=
sys
.
getfilesystemencoding
()
self
.
assertEqual
(
fs_encoding
,
'utf-8'
)
check_fsencoding
(
fs_encoding
)
# Even in C locale
env
=
os
.
environ
.
copy
()
env
[
'LANG'
]
=
'C'
output
=
subprocess
.
check_output
(
[
sys
.
executable
,
"-c"
,
"import sys; print(sys.getfilesystemencoding())"
],
env
=
env
)
fs_encoding
=
output
.
rstrip
()
self
.
assertEqual
(
fs_encoding
,
b
'utf-8'
)
try
:
sys
.
executable
.
encode
(
'ascii'
)
except
UnicodeEncodeError
:
# Python doesn't start with ASCII locale if its path is not ASCII,
# see issue #8611
pass
else
:
env
=
os
.
environ
.
copy
()
env
[
'LANG'
]
=
'C'
output
=
subprocess
.
check_output
(
[
sys
.
executable
,
"-c"
,
"import sys; print(sys.getfilesystemencoding())"
],
env
=
env
)
fs_encoding
=
output
.
rstrip
()
.
decode
(
'ascii'
)
check_fsencoding
(
fs_encoding
)
def
test_setfilesystemencoding
(
self
):
old
=
sys
.
getfilesystemencoding
()
...
...
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