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
1637487a
Kaydet (Commit)
1637487a
authored
Ara 16, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Skip test if the path is too long for a AF_UNIX socket
üst
6ec29e29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
test_socket.py
Lib/test/test_socket.py
+16
-4
No files found.
Lib/test/test_socket.py
Dosyayı görüntüle @
1637487a
...
...
@@ -4268,17 +4268,29 @@ class TestUnixDomain(unittest.TestCase):
"system encoding {1!r}"
.
format
(
path
,
sys
.
getfilesystemencoding
()))
def
bind
(
self
,
sock
,
path
):
# Bind the socket
try
:
sock
.
bind
(
path
)
except
OSError
as
e
:
if
str
(
e
)
==
"AF_UNIX path too long"
:
self
.
skipTest
(
"Pathname {0!a} is too long to serve as a AF_UNIX path"
.
format
(
path
))
else
:
raise
def
testStrAddr
(
self
):
# Test binding to and retrieving a normal string pathname.
path
=
os
.
path
.
abspath
(
support
.
TESTFN
)
self
.
sock
.
bind
(
path
)
self
.
bind
(
self
.
sock
,
path
)
self
.
addCleanup
(
support
.
unlink
,
path
)
self
.
assertEqual
(
self
.
sock
.
getsockname
(),
path
)
def
testBytesAddr
(
self
):
# Test binding to a bytes pathname.
path
=
os
.
path
.
abspath
(
support
.
TESTFN
)
self
.
sock
.
bind
(
self
.
encoded
(
path
))
self
.
bind
(
self
.
sock
,
self
.
encoded
(
path
))
self
.
addCleanup
(
support
.
unlink
,
path
)
self
.
assertEqual
(
self
.
sock
.
getsockname
(),
path
)
...
...
@@ -4287,7 +4299,7 @@ class TestUnixDomain(unittest.TestCase):
# non-ASCII bytes supplied using surrogateescape encoding.
path
=
os
.
path
.
abspath
(
support
.
TESTFN_UNICODE
)
b
=
self
.
encoded
(
path
)
self
.
sock
.
bind
(
b
.
decode
(
"ascii"
,
"surrogateescape"
))
self
.
bind
(
self
.
sock
,
b
.
decode
(
"ascii"
,
"surrogateescape"
))
self
.
addCleanup
(
support
.
unlink
,
path
)
self
.
assertEqual
(
self
.
sock
.
getsockname
(),
path
)
...
...
@@ -4297,7 +4309,7 @@ class TestUnixDomain(unittest.TestCase):
if
support
.
TESTFN_UNENCODABLE
is
None
:
self
.
skipTest
(
"No unencodable filename available"
)
path
=
os
.
path
.
abspath
(
support
.
TESTFN_UNENCODABLE
)
self
.
sock
.
bind
(
path
)
self
.
bind
(
self
.
sock
,
path
)
self
.
addCleanup
(
support
.
unlink
,
path
)
self
.
assertEqual
(
self
.
sock
.
getsockname
(),
path
)
...
...
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