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

Importing multiprocessing breaks _checkmodule in _pickle.c #120170

Closed
@li-dan

Description

@li-dan

Bug report

Bug description:

#86572 describes a bug where importingmultiprocessing causespickle to determine the wrong module for objects without__module__.#23403 fixed the bug, but only for the pure Python implementation ofpickle. The C extension module is still broken.

Consider a filefoo.py containing:

deff():passdelf.__module__

Then, in an interactive session:

>>>importmultiprocessing>>>fromfooimportf>>>importpickle>>>importpickletools>>>pickletools.dis(pickle.dumps(f))0: \x80PROTO42: \x95FRAME2111: \x8cSHORT_BINUNICODE'__mp_main__'24: \x94MEMOIZE    (as0)25: \x8cSHORT_BINUNICODE'f'28: \x94MEMOIZE    (as1)29: \x93STACK_GLOBAL30: \x94MEMOIZE    (as2)31: .STOPhighestprotocolamongopcodes=4>>>pickletools.dis(pickle._dumps(f))0: \x80PROTO42: \x95FRAME1311: \x8cSHORT_BINUNICODE'foo'16: \x94MEMOIZE    (as0)17: \x8cSHORT_BINUNICODE'f'20: \x94MEMOIZE    (as1)21: \x93STACK_GLOBAL22: \x94MEMOIZE    (as2)23: .STOPhighestprotocolamongopcodes=4

pickle.dumps tries to importf from__mp_main__.pickle._dumps correctly determines thatf comes from thefoo module.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp