Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28326

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:multiprocessing.Process depends on sys.stdout being open
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.7, Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Mariatta, Valentin.Lorentz, davin, pitrou, tacocat, terry.reedy, tiagoantao
Priority:normalKeywords:patch

Created on2016-10-01 11:45 byValentin.Lorentz, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
mp.patchtiagoantao,2016-10-02 04:38Patch with test casereview
Pull Requests
URLStatusLinkedEdit
PR 1410closedtiagoantao,2017-05-03 02:29
PR 4073mergedpitrou,2017-10-22 09:06
PR 4075mergedpitrou,2017-10-22 09:46
Messages (8)
msg277807 -(view)Author: ProgVal (Valentin.Lorentz)Date: 2016-10-01 11:45
Hello,The following code:import sysimport multiprocessingsys.stdout.close()def foo():    passp = multiprocessing.Process(target=foo)p.start()Crashes with:Traceback (most recent call last):  File "foo.py", line 10, in <module>    p.start()  File "/usr/lib/python3.5/multiprocessing/process.py", line 105, in start    self._popen = self._Popen(self)  File "/usr/lib/python3.5/multiprocessing/context.py", line 212, in _Popen    return _default_context.get_context().Process._Popen(process_obj)  File "/usr/lib/python3.5/multiprocessing/context.py", line 267, in _Popen    return Popen(process_obj)  File "/usr/lib/python3.5/multiprocessing/popen_fork.py", line 17, in __init__    sys.stdout.flush()ValueError: I/O operation on closed file.This bug has been reported to me on a daemonized program (written prior toPEP 3143).
msg277849 -(view)Author: Tiago Antao (tiagoantao)*Date: 2016-10-02 04:38
I made a small patch for this. This is the first time I submit one, so please be careful with this...
msg278271 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2016-10-07 21:37
Patch looks plausible to me.  The flush calls definitely need to be guarded.
msg278273 -(view)Author: Tiago Antao (tiagoantao)*Date: 2016-10-07 21:51
This is the first patch that I am submitting. More than willing to do any changes deemed necessary...
msg304713 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2017-10-21 16:57
Inissue31804, we see that sys.stdout and sys.stderr can sometimes simply be None, so we must check for that too.
msg304737 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2017-10-22 09:40
New changesetdaeefd2e049b74340307481112a39f77de0f4769 by Antoine Pitrou in branch 'master':bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed or None. (#4073)https://github.com/python/cpython/commit/daeefd2e049b74340307481112a39f77de0f4769
msg304740 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2017-10-22 10:27
New changeset34ef6da8f5fb03b83268bd35b77fb2183c748b70 by Antoine Pitrou in branch '3.6':[3.6]bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed or None. (GH-4073).  (#4075)https://github.com/python/cpython/commit/34ef6da8f5fb03b83268bd35b77fb2183c748b70
msg304741 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2017-10-22 10:27
This is now fixed in 3.6 and 3.7.  Closing!
History
DateUserActionArgs
2022-04-11 14:58:37adminsetgithub: 72513
2018-03-11 18:15:55pitrouunlinkissue31804 superseder
2017-10-22 10:27:53pitrousetstatus: open -> closed
resolution: fixed
messages: +msg304741

stage: patch review -> resolved
2017-10-22 10:27:15pitrousetmessages: +msg304740
2017-10-22 09:46:42pitrousetpull_requests: +pull_request4045
2017-10-22 09:40:33pitrousetmessages: +msg304737
2017-10-22 09:06:46pitrousetpull_requests: +pull_request4043
2017-10-21 16:57:54pitrousetnosy: +pitrou

messages: +msg304713
versions: - Python 3.5
2017-10-20 20:39:55pitroulinkissue31804 superseder
2017-05-03 02:30:29tiagoantaosetversions: + Python 3.6, Python 3.7
2017-05-03 02:29:16tiagoantaosetpull_requests: +pull_request1515
2016-10-07 21:51:14tiagoantaosetmessages: +msg278273
2016-10-07 21:37:22terry.reedysetnosy: +terry.reedy
messages: +msg278271

type: behavior
stage: patch review
2016-10-02 04:38:18tiagoantaosetfiles: +mp.patch

nosy: +tiagoantao
messages: +msg277849

keywords: +patch
2016-10-01 22:47:48tacocatsetnosy: +tacocat
2016-10-01 17:28:22ned.deilysetnosy: +davin
2016-10-01 16:40:35Mariattasetnosy: +Mariatta
2016-10-01 11:45:34Valentin.Lorentzcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp