This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Charles Machalow
Recipients Charles Machalow, amaury.forgeotdarc, belopolsky, meador.inge
Date 2017-03-08.07:19:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488957581.03.0.142909648716.issue29753@psf.upfronthosting.co.za>
In-reply-to
Content
Took a quick look at the c code for this. The area at fault appears to be this section in cfield.c:

#ifndef MS_WIN32
    } else if (bitsize /* this is a bitfield request */
        && *pfield_size /* we have a bitfield open */
        && dict->size * 8 >= *pfield_size
        && (*pbitofs + bitsize) <= dict->size * 8) {
        /* expand bit field */
        fieldtype = EXPAND_BITFIELD;
#endif

The problem seems to be after the end of the 2nd c_uint16, it seems to think that the next 10 bytes should extend that c_uint16 to a c_uint32 instead of taking the type as the beginning of a new c_uint32. So I guess it is making the structure something like this:

                      ("P",       c_uint16),
                      ("L",       c_uint32, 9),
                      ("Pro",     c_uint32, 1),
                      ("G",       c_uint32, 1),
                      ("IB",      c_uint32, 1),
                      ("IR",      c_uint32, 1),
                      ("R",       c_uint32, 3),
                      ("T",       c_uint32, 10),
                      # And now this needs an extra 6 bits of padding to fill the c_uint32
                      ("C",       c_uint32, 20),
                      ("R2",      c_uint32, 2)
                      # And now this needs an extra 10 bits of padding to fill the c_uint32.

I guess that is how we get to 10... instead of the expected 8 bytes. I don't believe that this behavior is desired nor really makes logical sense.
History
Date User Action Args
2017-03-08 07:19:41Charles Machalowsetrecipients: + Charles Machalow, amaury.forgeotdarc, belopolsky, meador.inge
2017-03-08 07:19:41Charles Machalowsetmessageid: <1488957581.03.0.142909648716.issue29753@psf.upfronthosting.co.za>
2017-03-08 07:19:41Charles Machalowlinkissue29753 messages
2017-03-08 07:19:40Charles Machalowcreate