Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Issues with multiprocessing module on Python 3.8

Aperta
#508 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Riprodurre il problema installando Emu con Python 3.8 ed eseguendo il processo hello o sleep. Esaminare il percorso asincrono in pywps/app/Process.py e pywps/processing/basic.py, inclusi WPSResponse e il contesto della PR #505 di watchdog. Il lavoro è completato quando multiprocessing non genera più gli errori BufferedReader o di pickling delle funzioni segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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 <function do_first at 0x1061484c0>: 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 with Python 3.8 and run a process (hello, sleep).

Additional Information

Lingua principale
Python
Stelle
186
Fork
117
Merge medio
17g 23h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di geopython/pywps

Tutte le issue di geopython/pywps

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.