Message414145
So I wrote a patch for this issue and published submitted a MR. When I was working on the patch, I realized that there is another issue related to how string and byte array size alignment is calculated. As seen here: https://github.com/python/cpython/blob/3.10/Lib/multiprocessing/shared_memory.py#L303.
>>> from multiprocessing.shared_memory import ShareableList
>>> s_list = ShareableList(["12345678"])
>>> s_list.format
'16s'
I changed the calculation of
self._alignment * (len(item) // self._alignment + 1),
to
self._alignment * max(1, (len(item) - 1) // self._alignment + 1)
With the patch, this will give
>>> from multiprocessing.shared_memory import ShareableList
>>> s_list = ShareableList(["12345678"])
>>> s_list.format
'8s' |
|
Date |
User |
Action |
Args |
2022-02-27 08:44:39 | tcl326 | set | recipients:
+ tcl326, pitrou, davin |
2022-02-27 08:44:39 | tcl326 | set | messageid: <1645951479.36.0.903329240178.issue46799@roundup.psfhosted.org> |
2022-02-27 08:44:39 | tcl326 | link | issue46799 messages |
2022-02-27 08:44:39 | tcl326 | create | |
|