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
016884cb
Kaydet (Commit)
016884cb
authored
Eki 17, 2012
tarafından
Trent Nelson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #16257: make test_create_connection() handle ENETUNREACH.
üst
5595ab56
45bb613e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
test_socket.py
Lib/test/test_socket.py
+20
-1
No files found.
Lib/test/test_socket.py
Dosyayı görüntüle @
016884cb
...
...
@@ -4109,7 +4109,26 @@ class NetworkConnectionNoServer(unittest.TestCase):
port
=
support
.
find_unused_port
()
with
self
.
assertRaises
(
socket
.
error
)
as
cm
:
socket
.
create_connection
((
HOST
,
port
))
self
.
assertEqual
(
cm
.
exception
.
errno
,
errno
.
ECONNREFUSED
)
# Issue #16257: create_connection() calls getaddrinfo() against
# 'localhost'. This may result in an IPV6 addr being returned
# as well as an IPV4 one:
# >>> socket.getaddrinfo('localhost', port, 0, SOCK_STREAM)
# >>> [(2, 2, 0, '', ('127.0.0.1', 41230)),
# (26, 2, 0, '', ('::1', 41230, 0, 0))]
#
# create_connection() enumerates through all the addresses returned
# and if it doesn't successfully bind to any of them, it propagates
# the last exception it encountered.
#
# On Solaris, ENETUNREACH is returned in this circumstance instead
# of ECONNREFUSED. So, if that errno exists, add it to our list of
# expected errnos.
expected_errnos
=
[
errno
.
ECONNREFUSED
,
]
if
hasattr
(
errno
,
'ENETUNREACH'
):
expected_errnos
.
append
(
errno
.
ENETUNREACH
)
self
.
assertIn
(
cm
.
exception
.
errno
,
expected_errnos
)
def
test_create_connection_timeout
(
self
):
# Issue #9792: create_connection() should not recast timeout errors
...
...
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