Skip to content

AttributeError: Can't pickle local object 'lazy_call.<locals>._handler' #22

Closed

Description

@amirse

Hey there,
Running inside Github actions, using Poetry, I get this error:

packages/unittest_parallel/main.py", line 114, in main
    results = pool.map(test_manager.run_tests, test_suites)
  File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/multiprocessing/pool.py", line 540, in _handle_tasks
    put(task)
  File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object 'lazy_call.<locals>._handler'

I quick search came up with this which suggests changing the process forking type from spawn to fork.
I tried changing multiprocessing_context = multiprocessing.get_context(method='spawn') to fork but it didn't help.
I should mention that this is running on a runner using arm64, not x86_64...
Any thoughts on this?
The command line was very simple:
poetry run unittest-parallel -s <some_dir_with_tests>

thanks!

Activity

  1. amirse commented on Oct 8, 2024

    @amirse
    Author

    Hmm, OK nevermind about the arm64, since I just tried running the test on my machine and it's an x86_64 Ubuntu 24.04. Same deal..

  2. craigahobbs commented on Oct 8, 2024

    @craigahobbs
    Owner

    A couple of thoughts:

    Does the error happen every test run, or is it occasional, like #15? Does the issue happen in Python 3.11 or 3.12?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions