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
5cc4e2a0
Kaydet (Commit)
5cc4e2a0
authored
Ara 11, 2009
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7470: logging: fix bug in Unicode encoding fallback.
üst
6c4847fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
__init__.py
Lib/logging/__init__.py
+3
-3
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
5cc4e2a0
...
@@ -821,9 +821,9 @@ class StreamHandler(Handler):
...
@@ -821,9 +821,9 @@ class StreamHandler(Handler):
try
:
try
:
if
(
isinstance
(
msg
,
unicode
)
and
if
(
isinstance
(
msg
,
unicode
)
and
getattr
(
stream
,
'encoding'
,
None
)):
getattr
(
stream
,
'encoding'
,
None
)):
fs
=
fs
.
decode
(
stream
.
encoding
)
u
fs
=
fs
.
decode
(
stream
.
encoding
)
try
:
try
:
stream
.
write
(
fs
%
msg
)
stream
.
write
(
u
fs
%
msg
)
except
UnicodeEncodeError
:
except
UnicodeEncodeError
:
#Printing to terminals sometimes fails. For example,
#Printing to terminals sometimes fails. For example,
#with an encoding of 'cp1251', the above write will
#with an encoding of 'cp1251', the above write will
...
@@ -831,7 +831,7 @@ class StreamHandler(Handler):
...
@@ -831,7 +831,7 @@ class StreamHandler(Handler):
#the codecs module, but fail when writing to a
#the codecs module, but fail when writing to a
#terminal even when the codepage is set to cp1251.
#terminal even when the codepage is set to cp1251.
#An extra encoding step seems to be needed.
#An extra encoding step seems to be needed.
stream
.
write
((
fs
%
msg
)
.
encode
(
stream
.
encoding
))
stream
.
write
((
u
fs
%
msg
)
.
encode
(
stream
.
encoding
))
else
:
else
:
stream
.
write
(
fs
%
msg
)
stream
.
write
(
fs
%
msg
)
except
UnicodeError
:
except
UnicodeError
:
...
...
Misc/NEWS
Dosyayı görüntüle @
5cc4e2a0
...
@@ -15,6 +15,8 @@ Core and Builtins
...
@@ -15,6 +15,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #7470: logging: fix bug in Unicode encoding fallback.
- Issue #5949: fixed IMAP4_SSL hang when the IMAP server response is
- Issue #5949: fixed IMAP4_SSL hang when the IMAP server response is
missing proper end-of-line termination.
missing proper end-of-line termination.
...
...
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