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
daeefd2e
Kaydet (Commit)
daeefd2e
authored
Eki 22, 2017
tarafından
Antoine Pitrou
Kaydeden (comit)
GitHub
Eki 22, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed or None. (#4073)
üst
73c47086
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
popen_fork.py
Lib/multiprocessing/popen_fork.py
+8
-2
_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+21
-0
2017-10-22-11-06-02.bpo-28326.rxh7L4.rst
...S.d/next/Library/2017-10-22-11-06-02.bpo-28326.rxh7L4.rst
+1
-0
No files found.
Lib/multiprocessing/popen_fork.py
Dosyayı görüntüle @
daeefd2e
...
@@ -14,8 +14,14 @@ class Popen(object):
...
@@ -14,8 +14,14 @@ class Popen(object):
method
=
'fork'
method
=
'fork'
def
__init__
(
self
,
process_obj
):
def
__init__
(
self
,
process_obj
):
sys
.
stdout
.
flush
()
try
:
sys
.
stderr
.
flush
()
sys
.
stdout
.
flush
()
except
(
AttributeError
,
ValueError
):
pass
try
:
sys
.
stderr
.
flush
()
except
(
AttributeError
,
ValueError
):
pass
self
.
returncode
=
None
self
.
returncode
=
None
self
.
finalizer
=
None
self
.
finalizer
=
None
self
.
_launch
(
process_obj
)
self
.
_launch
(
process_obj
)
...
...
Lib/test/_test_multiprocessing.py
Dosyayı görüntüle @
daeefd2e
...
@@ -582,6 +582,27 @@ class _TestProcess(BaseTestCase):
...
@@ -582,6 +582,27 @@ class _TestProcess(BaseTestCase):
proc
.
join
()
proc
.
join
()
self
.
assertTrue
(
evt
.
is_set
())
self
.
assertTrue
(
evt
.
is_set
())
@classmethod
def
_test_error_on_stdio_flush
(
self
,
evt
):
evt
.
set
()
def
test_error_on_stdio_flush
(
self
):
streams
=
[
io
.
StringIO
(),
None
]
streams
[
0
]
.
close
()
for
stream_name
in
(
'stdout'
,
'stderr'
):
for
stream
in
streams
:
old_stream
=
getattr
(
sys
,
stream_name
)
setattr
(
sys
,
stream_name
,
stream
)
try
:
evt
=
self
.
Event
()
proc
=
self
.
Process
(
target
=
self
.
_test_error_on_stdio_flush
,
args
=
(
evt
,))
proc
.
start
()
proc
.
join
()
self
.
assertTrue
(
evt
.
is_set
())
finally
:
setattr
(
sys
,
stream_name
,
old_stream
)
#
#
#
#
...
...
Misc/NEWS.d/next/Library/2017-10-22-11-06-02.bpo-28326.rxh7L4.rst
0 → 100644
Dosyayı görüntüle @
daeefd2e
Fix multiprocessing.Process when stdout and/or stderr is closed or None.
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