Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyoxidizer multiprocessing problem. #748

Open
jonike opened this issue Jun 6, 2024 · 2 comments
Open

Pyoxidizer multiprocessing problem. #748

jonike opened this issue Jun 6, 2024 · 2 comments

Comments

@jonike
Copy link

jonike commented Jun 6, 2024

Hello, guys.
When i compile program to pyoxidizer app in windows and run it. it's give me a error:

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

#code :

    import multiprocessing
    
    def run_webview():
       ...
    
    p = multiprocessing.Process(target=run_webview,args=())
    p.start()

What happen?

@jonike
Copy link
Author

jonike commented Jun 6, 2024

IN Lib/multiprocessing/reduction.py:

def duplicate(handle, target_process=None, inheritable=False, *, source_process=None):
        '''Duplicate a handle.  (target_process is a handle not a pid!)'''
        current_process = _winapi.GetCurrentProcess()
        if source_process is None:
            source_process = current_process
        if target_process is None:
            target_process = current_process

        print("source_process:", source_process)
        print("handle:", handle)
        print("target_process:",target_process)

        return _winapi.DuplicateHandle(
            source_process, handle, target_process,
            0, inheritable, _winapi.DUPLICATE_SAME_ACCESS)

==========================
Result In python.exe
source_process: 344
handle: 348
target_process: 18446744073709551615

Result in pyoxidizer compiled.exe
source_process: 18446744073709551615
handle: {'parent_pid': 21052, 'pipe_handle': 332}
target_process: 18446744073709551615

Please, anyone can help me?

@GPla
Copy link

GPla commented Jul 30, 2024

Duplicate of #698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants