[issue34610] Incorrect iteration of Manager.dict() method of the multiprocessing module.

deltaclock report at bugs.python.org
Fri Sep 7 19:43:37 EDT 2018


New submission from deltaclock <deltaclock at protonmail.com>:

The manager class of the multiprocessing module doesnt implement __next__ or __iter__ on its dictionary method and relies on using __getitem__.

This results in an unexpected functionality of an object that is supposed to act like a dict, and instead of looping over the dictionary keys it loops over its values.

The user needs to call dict() on this object in order to loop over it correctly, which is not that obvious.

The problem originates from there https://github.com/python/cpython/blob/master/Lib/multiprocessing/managers.py#L1136

Poc link: https://hastebin.com/codoqihowi.py

----------
components: Library (Lib)
files: test.py
messages: 324813
nosy: deltaclock
priority: normal
severity: normal
status: open
title: Incorrect iteration of Manager.dict() method of the multiprocessing module.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47792/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34610>
_______________________________________


More information about the Python-bugs-list mailing list