Issues with multiprocessing module on Python 3.8
- Dominant language
- Python
- Stars
- 186
- Forks
- 117
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 1
Description
# Description
There are issues with the Python `multiprocessing` module on Python 3.8 when executing a process.
On the current master (v4.2.3) I get the following exception:
```
2020-01-10 16:17:20,375] [ERROR] line=45 module=exceptions Exception: code: 500, description: No applicable error code, please check error log., locator:
Traceback (most recent call last):
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Service.py", line 336, in call
raise e
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Service.py", line 326, in call
response = self.execute(
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Service.py", line 81, in execute
return self._parse_and_execute(process, wps_request, uuid)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Service.py", line 169, in _parse_and_execute
wps_response = process.execute(wps_request, uuid)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Process.py", line 140, in execute
wps_response = self._execute_process(self.async_, wps_request, wps_response)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Process.py", line 184, in _execute_process
self._run_async(wps_request, wps_response)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/app/Process.py", line 213, in _run_async
process.start()
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/site-packages/pywps/processing/basic.py", line 36, in start
process.start()
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/Users/pingu/miniconda3/envs/emu/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_io.BufferedReader' object
```
Similar this happens also on the watchdog PR #505 with this exception:
```
line=45 module=queue PyWPS job queue failed: Can't pickle : it's not the same object as jinja2.filters.do_first
```
Probably in this case it happens because `WPSResponse` has a reference to a jinja template environment.
# Environment
- operating system:
- Python version: 3.8
- PyWPS version: >=4.2.3
- source/distribution
- [ ] git clone
- [ ] Debian
- [ ] PyPI
- [ ] zip/tar.gz
- [ ] other (please specify):
- web server
- [ ] Apache/mod_wsgi
- [ ] CGI
- [ ] other (please specify):
# Steps to Reproduce
Install [Emu](https://github.com/bird-house/emu) with Python 3.8 and run a process (hello, sleep).
# Additional Information
Contributor guide
Assessment
This issue has not been assessed yet.