Title: bytearray_getitem() handles negative index incorrectly
Type: behavior Stage: patch review
Components: Interpreter Core Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: sir-sigurd, twouters
Priority: normal Keywords: patch

Created on 2019-08-13 11:50 by sir-sigurd, last changed 2019-09-09 16:28 by twouters.

Pull Requests
URL Status Linked Edit
PR 15250 merged sir-sigurd, 2019-08-13 11:52
Messages (2)
msg349545 - (view) Author: Sergey Fedoseev (sir-sigurd) * Date: 2019-08-13 11:50
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.
msg351522 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2019-09-09 16:28
New changeset 92709a263e9cec0bc646ccc1ea051fc528800d8d by T. Wouters (Sergey Fedoseev) in branch 'master':
bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250)
Date User Action Args
2019-09-09 16:28:38twouterssetnosy: + twouters
messages: + msg351522
2019-08-13 11:52:43sir-sigurdsetkeywords: + patch
stage: patch review
pull_requests: + pull_request14972
2019-08-13 11:50:02sir-sigurdcreate