error in tox: AttributeError: Can't pickle local object 'time_limit.<locals>.capture_results'

Bug #1998146 reported by gdemengin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Jenkins
In Progress
Undecided
Unassigned

Bug Description

on macos with python 3.8 "tox -e py38" fails with this error

==============================
Failed 1 tests - output below:
==============================

tests.test_jenkins_sockets.JenkinsRequestTimeoutTests.test_jenkins_open_no_timeout
----------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/Users/gdm/workspace/python-jenkins/master/tests/test_jenkins_sockets.py", line 42, in test_jenkins_open_no_timeout
    time_limit(0.5, self.messages,

      File "/Users/gdm/workspace/python-jenkins/master/tests/helper.py", line 50, in time_limit
    p.start()

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)

      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)

    AttributeError: Can't pickle local object 'time_limit.<locals>.capture_results'

according to https://stackoverflow.com/questions/72766345/attributeerror-cant-pickle-local-object-in-multiprocessing replacing multiprocessing by multiprocess could help

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-jenkins (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/jjb/python-jenkins/+/865915

Changed in python-jenkins:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.