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
e4dcbbd7
Unverified
Kaydet (Commit)
e4dcbbd7
authored
Agu 07, 2018
tarafından
Berker Peksag
Kaydeden (comit)
GitHub
Agu 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
üst
3c1b5904
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
imaplib.py
Lib/imaplib.py
+5
-1
test_imaplib.py
Lib/test/test_imaplib.py
+14
-0
2018-08-02-21-28-38.bpo-18540.AryoYY.rst
...S.d/next/Library/2018-08-02-21-28-38.bpo-18540.AryoYY.rst
+3
-0
No files found.
Lib/imaplib.py
Dosyayı görüntüle @
e4dcbbd7
...
...
@@ -282,7 +282,11 @@ class IMAP4:
def
_create_socket
(
self
):
return
socket
.
create_connection
((
self
.
host
,
self
.
port
))
# Default value of IMAP4.host is '', but socket.getaddrinfo()
# (which is used by socket.create_connection()) expects None
# as a default value for host.
host
=
None
if
not
self
.
host
else
self
.
host
return
socket
.
create_connection
((
host
,
self
.
port
))
def
open
(
self
,
host
=
''
,
port
=
IMAP4_PORT
):
"""Setup connection to remote server on "host:port"
...
...
Lib/test/test_imaplib.py
Dosyayı görüntüle @
e4dcbbd7
from
test
import
support
from
contextlib
import
contextmanager
import
errno
import
imaplib
import
os.path
import
socketserver
...
...
@@ -69,6 +70,19 @@ class TestImaplib(unittest.TestCase):
for
t
in
self
.
timevalues
():
imaplib
.
Time2Internaldate
(
t
)
def
test_imap4_host_default_value
(
self
):
expected_errnos
=
[
# This is the exception that should be raised.
errno
.
ECONNREFUSED
,
]
if
hasattr
(
errno
,
'EADDRNOTAVAIL'
):
# socket.create_connection() fails randomly with
# EADDRNOTAVAIL on Travis CI.
expected_errnos
.
append
(
errno
.
EADDRNOTAVAIL
)
with
self
.
assertRaises
(
OSError
)
as
cm
:
imaplib
.
IMAP4
()
self
.
assertIn
(
cm
.
exception
.
errno
,
expected_errnos
)
if
ssl
:
class
SecureTCPServer
(
socketserver
.
TCPServer
):
...
...
Misc/NEWS.d/next/Library/2018-08-02-21-28-38.bpo-18540.AryoYY.rst
0 → 100644
Dosyayı görüntüle @
e4dcbbd7
The :class:`imaplib.IMAP4` and :class:`imaplib.IMAP4_SSL` classes now
resolve to the local host IP correctly when the default value of *host*
parameter (``''``) is used.
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