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
74f04508
Kaydet (Commit)
74f04508
authored
Nis 16, 2009
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #5768: Change to Unicode output logic and test case for same.
üst
76162e30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
__init__.py
Lib/logging/__init__.py
+5
-5
test_logging.py
Lib/test/test_logging.py
+1
-0
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
74f04508
...
...
@@ -753,7 +753,7 @@ class StreamHandler(Handler):
The record is then written to the stream with a trailing newline. If
exception information is present, it is formatted using
traceback.print_exception and appended to the stream. If the stream
has an 'encoding' attribute, it is used to
encode the message befor
e
has an 'encoding' attribute, it is used to
determine how to do th
e
output to the stream.
"""
try
:
...
...
@@ -764,11 +764,11 @@ class StreamHandler(Handler):
stream
.
write
(
fs
%
msg
)
else
:
try
:
if
(
isinstance
(
msg
,
unicode
)
or
getattr
(
stream
,
'encoding'
,
None
)
is
None
):
stream
.
write
(
fs
%
msg
)
if
(
isinstance
(
msg
,
unicode
)
and
getattr
(
stream
,
'encoding'
,
None
)):
stream
.
write
(
fs
.
decode
(
stream
.
encoding
)
%
msg
)
else
:
stream
.
write
(
fs
%
msg
.
encode
(
stream
.
encoding
)
)
stream
.
write
(
fs
%
msg
)
except
UnicodeError
:
stream
.
write
(
fs
%
msg
.
encode
(
"UTF-8"
))
self
.
flush
()
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
74f04508
...
...
@@ -894,6 +894,7 @@ class EncodingTest(BaseTest):
message
=
u'
\u0434\u043e
\u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f
'
#Ensure it's written in a Cyrillic encoding
writer_class
=
codecs
.
getwriter
(
'cp1251'
)
writer_class
.
encoding
=
'cp1251'
stream
=
cStringIO
.
StringIO
()
writer
=
writer_class
(
stream
,
'strict'
)
handler
=
logging
.
StreamHandler
(
writer
)
...
...
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