Skip to content

fix: add missing multiprocessing.popen_spawn_posix stubs #8427

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

Merged
merged 3 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions stdlib/multiprocessing/popen_spawn_posix.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys
from multiprocessing.process import BaseProcess
from typing import ClassVar

from . import popen_fork
from .util import Finalize

if sys.platform != "win32":
__all__ = ["Popen"]

class _DupFd:
fd: int

def __init__(self, fd: int) -> None: ...
def detach(self) -> int: ...

class Popen(popen_fork.Popen):
DupFd: ClassVar[type[_DupFd]]
finalizer: Finalize
pid: int # may not exist if _launch raises in second try / except
sentinel: int # may not exist if _launch raises in second try / except

def __init__(self, process_obj: BaseProcess) -> None: ...
def duplicate_for_child(self, fd: int) -> int: ...
3 changes: 2 additions & 1 deletion tests/stubtest_allowlists/win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ syslog
termios
xxlimited

# multiprocessing.popen_fork and popen_forkserver exist on Windows but fail to import
# multiprocessing.popen_fork, popen_forkserver, and popen_spawn_posix exist on Windows but fail to import
multiprocessing.popen_fork
multiprocessing.popen_forkserver
multiprocessing.popen_spawn_posix

# Modules that rely on _curses
curses
Expand Down