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 mark.dickinson
Recipients mark.dickinson, ned.deily, ronaldoussoren, wayedt
Date 2014-07-20.08:25:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405844718.59.0.799463159444.issue22012@psf.upfronthosting.co.za>
In-reply-to
Content
For native struct packing / unpacking, it's not even clear to me that this should be considered a bug (though for standard unpacking it definitely is):  the primary use-case for native unpacking is unpacking a collection of bytes that was written (from Python, or C, or ...) on the same machine, and in that case we're only going to be unpacking 0s and 1s.

FWIW, the docs say: "Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be True when unpacking.", so for native packing either the docs or the code need to be fixed.

The simplest solution would be to replace `nu_bool` with something identical to `bu_bool`.  In theory that would break on any platform where "sizeof(_Bool)" is greater than 1.  In practice, I doubt that Python's going to meet such platforms in a hurry.
History
Date User Action Args
2014-07-20 08:25:18mark.dickinsonsetrecipients: + mark.dickinson, ronaldoussoren, ned.deily, wayedt
2014-07-20 08:25:18mark.dickinsonsetmessageid: <1405844718.59.0.799463159444.issue22012@psf.upfronthosting.co.za>
2014-07-20 08:25:18mark.dickinsonlinkissue22012 messages
2014-07-20 08:25:18mark.dickinsoncreate