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
56065d4c
Kaydet (Commit)
56065d4c
authored
Nis 09, 2019
tarafından
Quentin Dawans
Kaydeden (comit)
Miss Islington (bot)
Nis 09, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34139: Remove unix datagram socket from FS before binding (GH-8323)
https://bugs.python.org/issue34139
üst
5aaac94e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
base_events.py
Lib/asyncio/base_events.py
+14
-0
test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+14
-0
2018-07-18-11-25-34.bpo-34139.tKbmW7.rst
...S.d/next/Library/2018-07-18-11-25-34.bpo-34139.tKbmW7.rst
+1
-0
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
56065d4c
...
...
@@ -20,6 +20,7 @@ import heapq
import
itertools
import
os
import
socket
import
stat
import
subprocess
import
threading
import
time
...
...
@@ -1183,6 +1184,19 @@ class BaseEventLoop(events.AbstractEventLoop):
for
addr
in
(
local_addr
,
remote_addr
):
if
addr
is
not
None
and
not
isinstance
(
addr
,
str
):
raise
TypeError
(
'string is expected'
)
if
local_addr
and
local_addr
[
0
]
not
in
(
0
,
'
\x00
'
):
try
:
if
stat
.
S_ISSOCK
(
os
.
stat
(
local_addr
)
.
st_mode
):
os
.
remove
(
local_addr
)
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'
,
local_addr
,
err
)
addr_pairs_info
=
(((
family
,
proto
),
(
local_addr
,
remote_addr
)),
)
else
:
...
...
Lib/test/test_asyncio/test_base_events.py
Dosyayı görüntüle @
56065d4c
...
...
@@ -1662,6 +1662,20 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self
.
loop
.
run_until_complete
(
protocol
.
done
)
self
.
assertEqual
(
'CLOSED'
,
protocol
.
state
)
@unittest.skipUnless
(
hasattr
(
socket
,
'AF_UNIX'
),
'No UNIX Sockets'
)
def
test_create_datagram_endpoint_existing_sock_unix
(
self
):
with
test_utils
.
unix_socket_path
()
as
path
:
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
type
=
socket
.
SOCK_DGRAM
)
sock
.
bind
(
path
)
sock
.
close
()
coro
=
self
.
loop
.
create_datagram_endpoint
(
lambda
:
MyDatagramProto
(
create_future
=
True
,
loop
=
self
.
loop
),
path
,
family
=
socket
.
AF_UNIX
)
transport
,
protocol
=
self
.
loop
.
run_until_complete
(
coro
)
transport
.
close
()
self
.
loop
.
run_until_complete
(
protocol
.
done
)
def
test_create_datagram_endpoint_sock_sockopts
(
self
):
class
FakeSock
:
type
=
socket
.
SOCK_DGRAM
...
...
Misc/NEWS.d/next/Library/2018-07-18-11-25-34.bpo-34139.tKbmW7.rst
0 → 100644
Dosyayı görüntüle @
56065d4c
Remove stale unix datagram socket before binding
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