Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytearray_getitem() handles negative index incorrectly #82021

Closed
sir-sigurd mannequin opened this issue Aug 13, 2019 · 3 comments
Closed

bytearray_getitem() handles negative index incorrectly #82021

sir-sigurd mannequin opened this issue Aug 13, 2019 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@sir-sigurd
Copy link
Mannequin

sir-sigurd mannequin commented Aug 13, 2019

BPO 37840
Nosy @Yhg1s, @sir-sigurd, @iritkatriel
PRs
  • bpo-37840: Fix handling of negative indices in bytearray_getitem() #15250
  • 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 = <Date 2020-10-21.15:12:25.630>
    created_at = <Date 2019-08-13.11:50:02.708>
    labels = ['interpreter-core', 'type-bug']
    title = 'bytearray_getitem() handles negative index incorrectly'
    updated_at = <Date 2020-10-21.15:12:25.630>
    user = 'https://github.com/sir-sigurd'

    bugs.python.org fields:

    activity = <Date 2020-10-21.15:12:25.630>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-21.15:12:25.630>
    closer = 'iritkatriel'
    components = ['Interpreter Core']
    creation = <Date 2019-08-13.11:50:02.708>
    creator = 'sir-sigurd'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37840
    keywords = ['patch']
    message_count = 3.0
    messages = ['349545', '351522', '378376']
    nosy_count = 3.0
    nosy_names = ['twouters', 'sir-sigurd', 'iritkatriel']
    pr_nums = ['15250']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37840'
    versions = []

    @sir-sigurd
    Copy link
    Mannequin Author

    sir-sigurd mannequin commented Aug 13, 2019

    bytearray_getitem() adjusts negative index, though that's already done by PySequence_GetItem().
    This makes PySequence_GetItem(bytearray(1), -2) to return 0 instead of raise IndexError.

    @sir-sigurd sir-sigurd mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Aug 13, 2019
    @Yhg1s
    Copy link
    Member

    Yhg1s commented Sep 9, 2019

    New changeset 92709a2 by T. Wouters (Sergey Fedoseev) in branch 'master':
    bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250)
    92709a2

    @iritkatriel
    Copy link
    Member

    This seems complete, can it be closed?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants