Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue27039

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:bytearray.remove cannot remove bytes with value greater than 127
Type:behaviorStage:resolved
Components:Interpreter CoreVersions:Python 3.6, Python 3.5, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: serhiy.storchakaNosy List: Damien George, SilentGhost, llllllllll, python-dev, serhiy.storchaka
Priority:normalKeywords:patch

Created on2016-05-16 16:29 byDamien George, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
bytearray-remove.patchllllllllll,2016-05-16 17:38review
Messages (8)
msg265709 -(view)Author: Damien George (Damien George)Date: 2016-05-16 16:29
The following code fails with a ValueError (but I expect it to succeed):>>> bytearray([128]).remove(128)Tested with Python 2.7.11 and 3.5.1.  Probably it's a case of comparing a char (signed byte) with an unsigned value.
msg265711 -(view)Author: SilentGhost (SilentGhost)*(Python triager)Date: 2016-05-16 16:41
Test is not catching it, because it only deals with ascii part.
msg265714 -(view)Author: Joe Jevnik (llllllllll)*Date: 2016-05-16 17:38
This seems to just be a bug in the implementation of remove. I have a patch to fix this and a test case.
msg265717 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-05-16 18:58
LGTM.
msg265719 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-05-16 19:02
But we first need to test that value is in the range from 0 to 255.
msg265720 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-05-16 19:03
But we first need to test that value is in the range from 0 to 255.
msg265722 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-05-16 19:07
Ah, this is already checked in the converter.
msg265726 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-05-16 19:25
New changeset10444778d41c by Serhiy Storchaka in branch '3.5':Issue#27039: Fixed bytearray.remove() for values greater than 127.https://hg.python.org/cpython/rev/10444778d41cNew changeset9acf44b7ff7b by Serhiy Storchaka in branch '2.7':Issue#27039: Fixed bytearray.remove() for values greater than 127.https://hg.python.org/cpython/rev/9acf44b7ff7bNew changeset3eb502d43616 by Serhiy Storchaka in branch 'default':Issue#27039: Fixed bytearray.remove() for values greater than 127.https://hg.python.org/cpython/rev/3eb502d43616
History
DateUserActionArgs
2022-04-11 14:58:31adminsetgithub: 71226
2016-05-16 19:25:52serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2016-05-16 19:25:07python-devsetnosy: +python-dev
messages: +msg265726
2016-05-16 19:07:35serhiy.storchakasetmessages: +msg265722
2016-05-16 19:03:01serhiy.storchakasetmessages: +msg265720
2016-05-16 19:02:57serhiy.storchakasetmessages: +msg265719
2016-05-16 18:58:43serhiy.storchakasetassignee:serhiy.storchaka
messages: +msg265717
stage: commit review
2016-05-16 17:38:20llllllllllsetfiles: +bytearray-remove.patch

nosy: +llllllllll
messages: +msg265714

keywords: +patch
2016-05-16 16:41:58SilentGhostsetnosy: +SilentGhost
messages: +msg265711
2016-05-16 16:39:45SilentGhostsetnosy: +serhiy.storchaka

versions: + Python 3.6
2016-05-16 16:29:48Damien Georgecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp