Skip to content

multiprocessing.Array misleading error message in slice assignment #76186

Open

Description

@stevendaprano
BPO 32005
Nosy @stevendaprano

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2017-11-10.23:53:08.892>
labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
title = 'multiprocessing.Array misleading error message in slice assignment'
updated_at = <Date 2021-06-22.11:57:27.362>
user = 'https://github.com/stevendaprano'

bugs.python.org fields:

activity = <Date 2021-06-22.11:57:27.362>
actor = 'iritkatriel'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2017-11-10.23:53:08.892>
creator = 'steven.daprano'
dependencies = []
files = []
hgrepos = []
issue_num = 32005
keywords = []
message_count = 1.0
messages = ['306066']
nosy_count = 1.0
nosy_names = ['steven.daprano']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue32005'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

Linked PRs

Activity

  1. stevendaprano commented on Nov 10, 2017

    @stevendaprano
    MemberAuthor

    multiprocessing.Array slice assignment claims to require a single character even if it requires more than one:

    py> arr = multiprocessing.Array('c', 3)
    py> arr[:] = b'xyz'  # works
    py> arr[:] = 'xyz'
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.5/multiprocessing/sharedctypes.py", line 226, in __setitem__
        self._obj[i] = value
    TypeError: one character bytes, bytearray or integer expected
  2. added
    stdlib
    type-bug
    on Nov 10, 2017
  3. changed the title [-]mutliprocessing.Array misleading error message in slice assignment[/-] [+]multiprocessing.Array misleading error message in slice assignment[/+] on Nov 11, 2017
  4. added
    3.9 (EOL)
    3.10 (EOL)
    3.11
    on Jun 22, 2021
  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)3.113.9 (EOL)stdlibtopic-multiprocessingtype-bug

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions