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
b2bef62e
Kaydet (Commit)
b2bef62e
authored
Mar 18, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19977: Fix test_capi when LC_CTYPE locale is POSIX
üst
97f17a78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
test_capi.py
Lib/test/test_capi.py
+18
-14
_testembed.c
Modules/_testembed.c
+2
-2
No files found.
Lib/test/test_capi.py
Dosyayı görüntüle @
b2bef62e
...
...
@@ -319,34 +319,38 @@ class EmbeddingTests(unittest.TestCase):
print
()
print
(
out
)
print
(
err
)
expected_errors
=
sys
.
__stdout__
.
errors
expected_stdin_encoding
=
sys
.
__stdin__
.
encoding
expected_pipe_encoding
=
self
.
_get_default_pipe_encoding
()
expected_output
=
os
.
linesep
.
join
([
"--- Use defaults ---"
,
"Expected encoding: default"
,
"Expected errors: default"
,
"stdin: {
0}:strict
"
,
"stdout: {
1}:strict
"
,
"stderr: {
1
}:backslashreplace"
,
"stdin: {
in_encoding}:{errors}
"
,
"stdout: {
out_encoding}:{errors}
"
,
"stderr: {
out_encoding
}:backslashreplace"
,
"--- Set errors only ---"
,
"Expected encoding: default"
,
"Expected errors:
surrogateescap
e"
,
"stdin: {
0}:surrogateescap
e"
,
"stdout: {
1}:surrogateescap
e"
,
"stderr: {
1
}:backslashreplace"
,
"Expected errors:
ignor
e"
,
"stdin: {
in_encoding}:ignor
e"
,
"stdout: {
out_encoding}:ignor
e"
,
"stderr: {
out_encoding
}:backslashreplace"
,
"--- Set encoding only ---"
,
"Expected encoding: latin-1"
,
"Expected errors: default"
,
"stdin: latin-1:
strict
"
,
"stdout: latin-1:
strict
"
,
"stdin: latin-1:
{errors}
"
,
"stdout: latin-1:
{errors}
"
,
"stderr: latin-1:backslashreplace"
,
"--- Set encoding and errors ---"
,
"Expected encoding: latin-1"
,
"Expected errors: surrogateescape"
,
"stdin: latin-1:surrogateescape"
,
"stdout: latin-1:surrogateescape"
,
"stderr: latin-1:backslashreplace"
])
.
format
(
expected_stdin_encoding
,
expected_pipe_encoding
)
"Expected errors: replace"
,
"stdin: latin-1:replace"
,
"stdout: latin-1:replace"
,
"stderr: latin-1:backslashreplace"
])
expected_output
=
expected_output
.
format
(
in_encoding
=
expected_stdin_encoding
,
out_encoding
=
expected_pipe_encoding
,
errors
=
expected_errors
)
# This is useful if we ever trip over odd platform behaviour
self
.
maxDiff
=
None
self
.
assertEqual
(
out
.
strip
(),
expected_output
)
...
...
Modules/_testembed.c
Dosyayı görüntüle @
b2bef62e
...
...
@@ -109,11 +109,11 @@ static void test_forced_io_encoding(void)
printf
(
"--- Use defaults ---
\n
"
);
check_stdio_details
(
NULL
,
NULL
);
printf
(
"--- Set errors only ---
\n
"
);
check_stdio_details
(
NULL
,
"
surrogateescap
e"
);
check_stdio_details
(
NULL
,
"
ignor
e"
);
printf
(
"--- Set encoding only ---
\n
"
);
check_stdio_details
(
"latin-1"
,
NULL
);
printf
(
"--- Set encoding and errors ---
\n
"
);
check_stdio_details
(
"latin-1"
,
"
surrogateescap
e"
);
check_stdio_details
(
"latin-1"
,
"
replac
e"
);
/* Check calling after initialization fails */
Py_Initialize
();
...
...
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