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
a5cd255a
Kaydet (Commit)
a5cd255a
authored
Eki 15, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Close #19267: Fix support of multibyte encoding (ex: UTF-16) in the logging
module.
üst
8ad0eac7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
__init__.py
Lib/logging/__init__.py
+1
-1
test_logging.py
Lib/test/test_logging.py
+18
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
a5cd255a
...
...
@@ -857,7 +857,7 @@ class StreamHandler(Handler):
try
:
if
(
isinstance
(
msg
,
unicode
)
and
getattr
(
stream
,
'encoding'
,
None
)):
ufs
=
fs
.
decode
(
stream
.
encoding
)
ufs
=
u'
%
s
\n
'
try
:
stream
.
write
(
ufs
%
msg
)
except
UnicodeEncodeError
:
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
a5cd255a
...
...
@@ -1060,6 +1060,24 @@ class EncodingTest(BaseTest):
#Compare against what the data should be when encoded in CP-1251
self
.
assertEqual
(
s
,
'
\xe4\xee
\xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n
'
)
def
test_encoding_utf16_unicode
(
self
):
# Issue #19267
log
=
logging
.
getLogger
(
"test"
)
message
=
u'b
\u0142\u0105
d'
writer_class
=
codecs
.
getwriter
(
'utf-16-le'
)
writer_class
.
encoding
=
'utf-16-le'
stream
=
cStringIO
.
StringIO
()
writer
=
writer_class
(
stream
,
'strict'
)
handler
=
logging
.
StreamHandler
(
writer
)
log
.
addHandler
(
handler
)
try
:
log
.
warning
(
message
)
finally
:
log
.
removeHandler
(
handler
)
handler
.
close
()
s
=
stream
.
getvalue
()
self
.
assertEqual
(
s
,
'b
\x00
B
\x01\x05\x01
d
\x00\n\x00
'
)
class
WarningsTest
(
BaseTest
):
...
...
Misc/NEWS
Dosyayı görüntüle @
a5cd255a
...
...
@@ -370,6 +370,9 @@ Library
- Issue #17926: Fix dbm.__contains__ on 64-bit big-endian machines.
- Issue #19267: Fix support of multibyte encoding (ex: UTF-16) in the logging
module.
- Issue #17918: When using SSLSocket.accept(), if the SSL handshake failed
on the new socket, the socket would linger indefinitely. Thanks to
Peter Saveliev for reporting.
...
...
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