indygreg / indygreg/PyOxidizer

Windows multiprocessing spawn error

Open
#698 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

While using the multiprocessing library on Windows, I get the following error:

```shell
Traceback (most recent call last):
File "multiprocessing.spawn", line 107, in spawn_main
File "multiprocessing.reduction", line 79, in duplicate
TypeError: DuplicateHandle() argument 2 must be int, not dict
```

The code I'm using is roughly:

```python
with multiprocessing.Pool(
processes=, initializer=, initargs=[, ]
) as pool:
output = pool.map(
,
tqdm(tqdm(>, fh=))
)
```

The use of `tqdm` with a file handler is just so that progress logging can be written to file, and replacing it with an ordinary list yields the same error. The code itself builds and executes just fine on linux and macOS (both Intel and ARM).

I've tried various configurations suggested [here](https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_packaging_multiprocessing.html) without success. Any insight as to what could be happening? Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows multiprocessing failure with the shown Pool example and an ordinary list, then review the linked PyOxidizer multiprocessing packaging guidance. Done means the packaged application can use multiprocessing on Windows without the DuplicateHandle TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.