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
65d66e10
Kaydet (Commit)
65d66e10
authored
Eyl 04, 2008
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #3772: Fixed regression problem in StreamHandler.emit().
üst
a0b7444f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
__init__.py
Lib/logging/__init__.py
+1
-1
test_logging.py
Lib/test/test_logging.py
+27
-1
NEWS
Misc/NEWS
+3
-1
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
65d66e10
...
@@ -757,7 +757,7 @@ class StreamHandler(Handler):
...
@@ -757,7 +757,7 @@ class StreamHandler(Handler):
self
.
stream
.
write
(
fs
%
msg
)
self
.
stream
.
write
(
fs
%
msg
)
else
:
else
:
try
:
try
:
if
hasattr
(
self
.
stream
,
'encoding'
)
:
if
getattr
(
self
.
stream
,
'encoding'
,
None
)
is
not
None
:
self
.
stream
.
write
(
fs
%
msg
.
encode
(
self
.
stream
.
encoding
))
self
.
stream
.
write
(
fs
%
msg
.
encode
(
self
.
stream
.
encoding
))
else
:
else
:
self
.
stream
.
write
(
fs
%
msg
)
self
.
stream
.
write
(
fs
%
msg
)
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
65d66e10
...
@@ -859,6 +859,31 @@ class MemoryTest(BaseTest):
...
@@ -859,6 +859,31 @@ class MemoryTest(BaseTest):
(
'foo'
,
'DEBUG'
,
'3'
),
(
'foo'
,
'DEBUG'
,
'3'
),
])
])
class
EncodingTest
(
BaseTest
):
def
test_encoding_plain_file
(
self
):
# In Python 2.x, a plain file object is treated as having no encoding.
log
=
logging
.
getLogger
(
"test"
)
fn
=
tempfile
.
mktemp
(
".log"
)
# the non-ascii data we write to the log.
data
=
"foo
\x80
"
try
:
handler
=
logging
.
FileHandler
(
fn
)
log
.
addHandler
(
handler
)
try
:
# write non-ascii data to the log.
log
.
warning
(
data
)
finally
:
log
.
removeHandler
(
handler
)
handler
.
close
()
# check we wrote exactly those bytes, ignoring trailing \n etc
f
=
open
(
fn
)
try
:
self
.
failUnlessEqual
(
f
.
read
()
.
rstrip
(),
data
)
finally
:
f
.
close
()
finally
:
if
os
.
path
.
isfile
(
fn
):
os
.
remove
(
fn
)
# Set the locale to the platform-dependent default. I have no idea
# Set the locale to the platform-dependent default. I have no idea
# why the test does this, but in any case we save the current locale
# why the test does this, but in any case we save the current locale
...
@@ -867,7 +892,8 @@ class MemoryTest(BaseTest):
...
@@ -867,7 +892,8 @@ class MemoryTest(BaseTest):
def
test_main
():
def
test_main
():
run_unittest
(
BuiltinLevelsTest
,
BasicFilterTest
,
run_unittest
(
BuiltinLevelsTest
,
BasicFilterTest
,
CustomLevelsAndFiltersTest
,
MemoryHandlerTest
,
CustomLevelsAndFiltersTest
,
MemoryHandlerTest
,
ConfigFileTest
,
SocketHandlerTest
,
MemoryTest
)
ConfigFileTest
,
SocketHandlerTest
,
MemoryTest
,
EncodingTest
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
Misc/NEWS
Dosyayı görüntüle @
65d66e10
...
@@ -56,6 +56,8 @@ C-API
...
@@ -56,6 +56,8 @@ C-API
Library
Library
-------
-------
- Issue #3772: Fixed regression problem in StreamHandler.emit().
- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
to the urlparse one. Added a PendingDeprecationWarning in the old
to the urlparse one. Added a PendingDeprecationWarning in the old
module, it will be deprecated in the future.
module, it will be deprecated in the future.
...
@@ -87,7 +89,7 @@ Library
...
@@ -87,7 +89,7 @@ Library
- Issue #3708: os.urandom no longer goes into an infinite loop when passed a
- Issue #3708: os.urandom no longer goes into an infinite loop when passed a
non-integer floating point number.
non-integer floating point number.
- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
SEM_VALUE_MAX.
SEM_VALUE_MAX.
Extension Modules
Extension Modules
...
...
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