This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Starting multiprocessing.Process raises FileNotFoundError unexpectedly
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Donny Brown, davin, iritkatriel, pitrou
Priority: normal Keywords:

Created on 2019-09-08 14:06 by Donny Brown, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py Donny Brown, 2019-09-08 14:06
Messages (3)
msg351328 - (view) Author: Donny Brown (Donny Brown) Date: 2019-09-08 14:06
Starting multiprocessing.Process causes FileNotFoundError in certain case:

```
import multiprocessing as mp
import time

def demo(f):
    print(f)

def main():
    cxt=mp.get_context('spawn')
    f=cxt.Value('i', 0)
    p=cxt.Process(target=demo, args=[f])
    p.start()

    return p

if __name__ == "__main__":
    p=main()
    p.join()
```

In this example, 'f' is supposed to stay in memory since it is referred by p._args. However, starting the process raises FileNotFoundError once there is not explicit reference to the arguments passed to the new process in the original process.
msg376246 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-02 14:49
On windows 10, Python 3.10 I don't get a FileNotFoundError from this script. Which system and python version are you seeing it on?
msg396529 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-25 22:43
Closing as there isn't enough information about the problem. If you are still seeing it, please create a new issue with full details.
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82236
2021-06-25 22:43:08iritkatrielsetstatus: open -> closed
resolution: rejected
messages: + msg396529

stage: resolved
2020-09-02 14:49:46iritkatrielsetnosy: + iritkatriel
messages: + msg376246
2019-09-10 06:33:14Donny Brownsettype: behavior
title: Starting multiprocessing.Process causes FileNotFoundError -> Starting multiprocessing.Process raises FileNotFoundError unexpectedly
2019-09-08 14:06:55Donny Browncreate