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
25fcd220
Kaydet (Commit)
25fcd220
authored
Ara 06, 2009
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
logging: Improved support for SMTP over TLS.
üst
540f2152
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
handlers.py
Lib/logging/handlers.py
+9
-6
No files found.
Lib/logging/handlers.py
Dosyayı görüntüle @
25fcd220
...
...
@@ -804,7 +804,7 @@ class SMTPHandler(logging.Handler):
A handler class which sends an SMTP email for each logging event.
"""
def
__init__
(
self
,
mailhost
,
fromaddr
,
toaddrs
,
subject
,
credentials
=
None
,
secure
=
Fals
e
):
credentials
=
None
,
secure
=
Non
e
):
"""
Initialize the handler.
...
...
@@ -812,9 +812,12 @@ class SMTPHandler(logging.Handler):
line of the email. To specify a non-standard SMTP port, use the
(host, port) tuple format for the mailhost argument. To specify
authentication credentials, supply a (username, password) tuple
for the credentials argument. To specify the use of a secure
protocol (TLS), pass in True for the secure argument. This will
only be used when authentication credentials are supplied.
for the credentials argument. To specify the use of a secure
protocol (TLS), pass in a tuple for the secure argument. This will
only be used when authentication credentials are supplied. The tuple
will be either an empty tuple, or a single-value tuple with the name
of a keyfile, or a 2-value tuple with the names of the keyfile and
certificate file. (This tuple is passed to the `starttls` method).
"""
logging
.
Handler
.
__init__
(
self
)
if
isinstance
(
mailhost
,
tuple
):
...
...
@@ -882,9 +885,9 @@ class SMTPHandler(logging.Handler):
self
.
getSubject
(
record
),
formatdate
(),
msg
)
if
self
.
username
:
if
self
.
secure
:
if
self
.
secure
is
not
None
:
smtp
.
ehlo
()
smtp
.
starttls
()
smtp
.
starttls
(
*
self
.
secure
)
smtp
.
ehlo
()
smtp
.
login
(
self
.
username
,
self
.
password
)
smtp
.
sendmail
(
self
.
fromaddr
,
self
.
toaddrs
,
msg
)
...
...
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