Skip to content

bytearray.translate() should support None first argument #49009

Closed

Description

@birkenfeld
BPO 4759
Nosy @birkenfeld, @pitrou, @benjaminp
Files
  • bytearray-translate.diff
  • 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 = 'https://github.com/birkenfeld'
    closed_at = <Date 2008-12-28.11:55:39.811>
    created_at = <Date 2008-12-27.23:28:50.931>
    labels = ['interpreter-core', 'type-bug']
    title = 'bytearray.translate() should support None first argument'
    updated_at = <Date 2008-12-28.11:55:39.802>
    user = 'https://github.com/birkenfeld'

    bugs.python.org fields:

    activity = <Date 2008-12-28.11:55:39.802>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-12-28.11:55:39.811>
    closer = 'georg.brandl'
    components = ['Interpreter Core']
    creation = <Date 2008-12-27.23:28:50.931>
    creator = 'georg.brandl'
    dependencies = []
    files = ['12476']
    hgrepos = []
    issue_num = 4759
    keywords = ['patch']
    message_count = 4.0
    messages = ['78390', '78392', '78396', '78397']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'pitrou', 'benjamin.peterson']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue4759'
    versions = ['Python 3.1', 'Python 2.7']

    Activity

    1. birkenfeld commented on Dec 27, 2008

      @birkenfeld
      MemberAuthor

      bytes.translate() does. Patch attached.

    2. added
      interpreter-core
      type-bug
      on Dec 27, 2008
    3. benjaminp commented on Dec 28, 2008

      @benjaminp
      Contributor

      Looks good to me. I don't think it should be applied to 3.0, though.

    4. pitrou commented on Dec 28, 2008

      @pitrou
      Member

      Looks like there's a problem:

      >>> bytearray().translate(None, None)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: Type NoneType doesn't support the buffer API
      >>> bytearray().translate(None, None)
      Erreur de segmentation

      Also, the patch should probably be backported to trunk.

    5. birkenfeld commented on Dec 28, 2008

      @birkenfeld
      MemberAuthor

      You're right (but the segfault isn't introduced by the patch).

      Fixed segfault in 3.0 and 2.6 in r67975 and r67977.
      Applied path in 3k and trunk in r67974 and r67976.

    6. 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

    Labels

    interpreter-coretype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions