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
d55b54d5
Kaydet (Commit)
d55b54d5
authored
Tem 17, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio, tulip issue 190: Process.communicate() now ignores
ConnectionResetError too
üst
cc996b57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
asyncio-subprocess.rst
Doc/library/asyncio-subprocess.rst
+5
-4
subprocess.py
Lib/asyncio/subprocess.py
+7
-5
No files found.
Doc/library/asyncio-subprocess.rst
Dosyayı görüntüle @
d55b54d5
...
...
@@ -191,9 +191,9 @@ Process
process, or ``None``, if no data should be sent to the child. The type
of *input* must be bytes.
If a :exc:`BrokenPipeError`
is raised when writing *input* into stdin,
the exception is ignored. It occurs when the process exits before all
data are written into stdin.
If a :exc:`BrokenPipeError`
or :exc:`ConnectionResetError` exception is
raised when writing *input* into stdin, the exception is ignored. It
occurs when the process exits before all
data are written into stdin.
:meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.
...
...
@@ -210,7 +210,8 @@ Process
This method is a :ref:`coroutine <coroutine>`.
.. versionchanged:: 3.4.2
The method now ignores :exc:`BrokenPipeError`.
The method now ignores :exc:`BrokenPipeError` and
:exc:`ConnectionResetError`.
.. method:: kill()
...
...
Lib/asyncio/subprocess.py
Dosyayı görüntüle @
d55b54d5
...
...
@@ -139,17 +139,19 @@ class Process:
@coroutine
def
_feed_stdin
(
self
,
input
):
debug
=
self
.
_loop
.
get_debug
()
self
.
stdin
.
write
(
input
)
if
self
.
_loop
.
get_debug
()
:
if
debug
:
logger
.
debug
(
'
%
r communicate: feed stdin (
%
s bytes)'
,
self
,
len
(
input
))
try
:
yield
from
self
.
stdin
.
drain
()
except
BrokenPipeError
:
# ignore BrokenPipeError
pass
except
(
BrokenPipeError
,
ConnectionResetError
)
as
exc
:
# communicate() ignores BrokenPipeError and ConnectionResetError
if
debug
:
logger
.
debug
(
'
%
r communicate: stdin got
%
r'
,
self
,
exc
)
if
self
.
_loop
.
get_debug
()
:
if
debug
:
logger
.
debug
(
'
%
r communicate: close stdin'
,
self
)
self
.
stdin
.
close
()
...
...
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