Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

set_forkserver_preload should check type of elements in passed list #107963

Closed
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error
@mawi2017

Description

@mawi2017

Checklist

  • I am confident this is a bug in CPython, not a bug in a third-party project
  • I have searched theCPython issue tracker,
    and am confident this bug has not been reported before

CPython versions tested on:

3.10

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0]

A clear and concise description of the bug:

The code forset_forkserver_preload (also in the latestmain branch) should check the type of the elements passed through themodule_names parameter, but instead checks the elements ofself._preload_modules.

Code for reproducing:

#!/usr/bin/env python3importmultiprocessingasmpimporttimedefwork(param):print("work")if__name__=='__main__':ctx=mp.get_context('forkserver')ctx.set_forkserver_preload(['time',1])withctx.Pool(2)asp:p.map(work, [0,1,2,3 ])

Raises error:

Traceback (most recent call last):  File "<string>", line 1, in <module>  File ".../lib/python3.10/multiprocessing/forkserver.py", line 178, in main    __import__(modname)TypeError: __import__() argument 1 must be str, not int

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp