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
467d12fc
Kaydet (Commit)
467d12fc
authored
Agu 19, 2010
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7077: Fixed SysLogHandler implementation of Unicode handling.
üst
12844e6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
handlers.py
Lib/logging/handlers.py
+4
-10
No files found.
Lib/logging/handlers.py
Dosyayı görüntüle @
467d12fc
...
...
@@ -732,12 +732,6 @@ class SysLogHandler(logging.Handler):
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
socket
.
connect
(
address
)
# curious: when talking to the unix-domain '/dev/log' socket, a
# zero-terminator seems to be required. this string is placed
# into a class variable so that it can be overridden if
# necessary.
log_format_string
=
'<
%
d>
%
s
\000
'
def
encodePriority
(
self
,
facility
,
priority
):
"""
Encode the facility and priority. You can pass in strings or
...
...
@@ -781,14 +775,14 @@ class SysLogHandler(logging.Handler):
We need to convert record level to lowercase, maybe this will
change in the future.
"""
msg
=
self
.
log_format_string
%
(
self
.
encodePriority
(
self
.
facility
,
self
.
mapPriority
(
record
.
levelname
)),
msg
)
prio
=
'<
%
d>'
%
self
.
encodePriority
(
self
.
facility
,
self
.
mapPriority
(
record
.
levelname
))
prio
=
prio
.
encode
(
'utf-8'
)
#Message is a string. Convert to bytes as required by RFC 5424
msg
=
msg
.
encode
(
'utf-8'
)
if
codecs
:
msg
=
codecs
.
BOM_UTF8
+
msg
msg
=
prio
+
msg
try
:
if
self
.
unixsocket
:
try
:
...
...
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