Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue23319

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:Missing SWAP_INT in I_set_sw
Type:behaviorStage:patch review
Components:ctypesVersions:Python 3.4, Python 3.5, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: meador.ingeNosy List: amaury.forgeotdarc, belopolsky, meador.inge, mgautierfr, python-dev, vstinner
Priority:normalKeywords:patch

Created on2015-01-25 18:53 bymgautierfr, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
ctypes_swap_uint.patchmgautierfr,2015-01-25 18:53Fix the bug. Add the missing SWAP_INT.review
ctypes_swap_uint_unittest.patchmgautierfr,2015-06-24 15:48Add missing SWAP_INT + unit_testreview
Messages (9)
msg234682 -(view)Author: Matthieu Gautier (mgautierfr)*Date: 2015-01-25 18:53
I_set_sw function is missing a SWAP_INT.This leads to wrong set of bitfield value.Here is a script to reproduce:----------from ctypes import *class HEADER(BigEndianStructure):   _fields_ = ( ('pad', c_uint32, 16),                ('v1', c_uint32, 4),                ('v2', c_uint32, 12)              )b = bytearray(4)header = HEADER.from_buffer(b)header.type = 1assert b == b'\x00\x00\x10\x00'header.mode = 0x234assert b == b'\x00\x00\x12\x34'----------
msg245758 -(view)Author: Matthieu Gautier (mgautierfr)*Date: 2015-06-24 15:48
A little ping.With a new patch integrating the unit test.
msg246509 -(view)Author: Meador Inge (meador.inge)*(Python committer)Date: 2015-07-09 15:44
I will review this today.
msg246797 -(view)Author: Matthieu Gautier (mgautierfr)*Date: 2015-07-16 09:47
The bug is also present in Python 2.7.Is it possible to backport this fix ?
msg247567 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-07-29 12:36
New changeset935ae7f001e3 by Victor Stinner in branch '3.4':Issue#23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patchhttps://hg.python.org/cpython/rev/935ae7f001e3
msg247568 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-07-29 12:37
New changeset88f2c4f12b56 by Victor Stinner in branch '2.7':Issue#23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patchhttps://hg.python.org/cpython/rev/88f2c4f12b56
msg247569 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2015-07-29 12:38
Thanks for your report, patch and unit test Matthieu. I rewrote the unit test because your layout was too complex for my little brain :-) I also write a unit test for little endian. I applied your fix to Python 2.7, 3.4, 3.5 and 3.6.
msg247570 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-07-29 12:41
New changeset12b353f76447 by Victor Stinner in branch '2.7':Issue#23319: Add Matthieu Gautier toMisc/ACKShttps://hg.python.org/cpython/rev/12b353f76447New changeset3caa68f55e3e by Victor Stinner in branch '3.4':Issue#23319: Add Matthieu Gautier toMisc/ACKShttps://hg.python.org/cpython/rev/3caa68f55e3e
msg247572 -(view)Author: Meador Inge (meador.inge)*(Python committer)Date: 2015-07-29 13:20
Thanks for committing this Victor.  The patch looked good to me too.  Sorry for not getting around to update the tracker.
History
DateUserActionArgs
2022-04-11 14:58:12adminsetgithub: 67508
2015-07-29 13:20:12meador.ingesetmessages: +msg247572
2015-07-29 12:41:34python-devsetmessages: +msg247570
2015-07-29 12:38:49vstinnersetstatus: open -> closed

nosy: +vstinner
messages: +msg247569

resolution: fixed
2015-07-29 12:37:39python-devsetmessages: +msg247568
2015-07-29 12:36:24python-devsetnosy: +python-dev
messages: +msg247567
2015-07-16 09:47:25mgautierfrsetmessages: +msg246797
versions: + Python 2.7
2015-07-09 15:44:47meador.ingesetassignee:meador.inge
messages: +msg246509
stage: patch review
2015-07-08 07:11:31mgautierfrsetversions: + Python 3.5
2015-06-24 17:31:57serhiy.storchakasetnosy: +amaury.forgeotdarc,belopolsky,meador.inge
2015-06-24 15:48:05mgautierfrsetfiles: +ctypes_swap_uint_unittest.patch

messages: +msg245758
2015-01-25 18:53:37mgautierfrcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp