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
908d55dd
Kaydet (Commit)
908d55dd
authored
Eki 09, 2016
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28399: Remove UNIX socket from FS before binding.
Patch by Коренберг Марк.
üst
0aa7887f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
unix_events.py
Lib/asyncio/unix_events.py
+11
-0
test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+7
-5
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/asyncio/unix_events.py
Dosyayı görüntüle @
908d55dd
...
...
@@ -258,6 +258,17 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
# Check for abstract socket. `str` and `bytes` paths are supported.
if
path
[
0
]
not
in
(
0
,
'
\x00
'
):
try
:
if
stat
.
S_ISSOCK
(
os
.
stat
(
path
)
.
st_mode
):
os
.
remove
(
path
)
except
FileNotFoundError
:
pass
except
OSError
as
err
:
# Directory may have permissions only to create socket.
logger
.
error
(
'Unable to check or remove stale UNIX socket
%
r:
%
r'
,
path
,
err
)
try
:
sock
.
bind
(
path
)
except
OSError
as
exc
:
...
...
Lib/test/test_asyncio/test_unix_events.py
Dosyayı görüntüle @
908d55dd
...
...
@@ -241,11 +241,13 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
with
test_utils
.
unix_socket_path
()
as
path
:
sock
=
socket
.
socket
(
socket
.
AF_UNIX
)
sock
.
bind
(
path
)
with
sock
:
coro
=
self
.
loop
.
create_unix_server
(
lambda
:
None
,
path
)
with
self
.
assertRaisesRegex
(
OSError
,
'Address.*is already in use'
):
self
.
loop
.
run_until_complete
(
coro
)
sock
.
listen
(
1
)
sock
.
close
()
coro
=
self
.
loop
.
create_unix_server
(
lambda
:
None
,
path
)
srv
=
self
.
loop
.
run_until_complete
(
coro
)
srv
.
close
()
self
.
loop
.
run_until_complete
(
srv
.
wait_closed
())
def
test_create_unix_server_existing_path_nonsock
(
self
):
with
tempfile
.
NamedTemporaryFile
()
as
file
:
...
...
Misc/NEWS
Dosyayı görüntüle @
908d55dd
...
...
@@ -385,6 +385,9 @@ Library
-
Issue
#
28372
:
Fix
asyncio
to
support
formatting
of
non
-
python
coroutines
.
-
Issue
#
28399
:
Remove
UNIX
socket
from
FS
before
binding
.
Patch
by
Коренберг
Марк
.
IDLE
----
...
...
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