doit auto crashes with python 3.8 on MacOS
See original GitHub issueDescribe the bug
Considering the following dodo.py
file :
/private/tmp$ cat dodo.py
def task_hello():
"""hello"""
def python_hello(targets):
with open(targets[0], "a") as output:
output.write("Python says Hello World!!!\n")
return {
'actions': [python_hello],
'targets': ["hello.txt"],
}
doit auto
works with python 3.7 :
/private/tmp$ doit --version
0.33.1
lib @ /private/tmp/.env/lib/python3.7/site-packages/doit
/private/tmp$ doit auto
. hello
^CProcess Process-1:
Traceback (most recent call last):
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/private/tmp/.env/lib/python3.7/site-packages/doit/cmd_auto.py", line 131, in run_watch
file_watcher.loop()
File "/private/tmp/.env/lib/python3.7/site-packages/doit/filewatch.py", line 100, in loop
self._loop_darwin()
File "/private/tmp/.env/lib/python3.7/site-packages/doit/filewatch.py", line 72, in _loop_darwin
observer.run()
File "/private/tmp/.env/lib/python3.7/site-packages/fsevents.py", line 116, in run
self.event.wait()
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 552, in wait
signaled = self._cond.wait(timeout)
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 296, in wait
waiter.acquire()
KeyboardInterrupt
but crashes with python 3.8 :
/private/tmp$ doit --version
0.33.1
lib @ /private/tmp/.env-3.8/lib/python3.8/site-packages/doit
/private/tmp$ doit auto
Traceback (most recent call last):
File "/private/tmp/.env-3.8/lib/python3.8/site-packages/doit/doit_cmd.py", line 190, in run
return command.parse_execute(args)
File "/private/tmp/.env-3.8/lib/python3.8/site-packages/doit/cmd_base.py", line 150, in parse_execute
return self.execute(params, args)
File "/private/tmp/.env-3.8/lib/python3.8/site-packages/doit/cmd_auto.py", line 139, in execute
proc.start()
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/Users/boileau/opt/anaconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_io.TextIOWrapper' object
Environment
- OS: MacOS 10.15.6
- python version: Python 3.8.3
- doit version: 0.33.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Developers - doit auto crashes with python 3.8 on MacOS -
Describe the bug. Considering the following dodo.py file : /private/tmp$ cat dodo.py def task_hello(): """hello""" def python_hello(targets): with ...
Read more >Mac OS Monterey Python Version? | Apple Developer Forums
Could someone tell me the default version of Python, installed with Mac OS Monterey? The one symlinked from /usr/bin/python to /System/Library/Frameworks.
Read more >Issue 33725: Python crashes on macOS after fork with no exec
msg318352 ‑ (view) Author: Kapil Thangavelu (kapilt) Date: 2018‑06‑01 00:53
msg318361 ‑ (view) Author: Ronald Oussoren (ronaldoussoren) * Date: 2018‑06‑01 05:51
msg318396 ‑ (view) Author:...
Read more >Install Python 3.8 on macOS - 3 of 9 - YouTube
Install Python 3.8 on macOS - 3 of 9 - Install & Activate a Virtual Environment with PipenvPython on macOS Install GUIDE: ...
Read more >Updating Python on Mac - Stack Overflow
The default Python on OS X shouldn't be messed with as it's used by the OS itself. If your default is 2.6.1 then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, but it can be fixed by manually setting it back to
fork
withmultiprocess.set_start_method('spawn')
before spawning a Process. I tested with the above snipper andauto
, and it worked inspawn
mode withmultiprocess
.@bollwyvl moving discussion to #404