Message223502
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. |
|
Date |
User |
Action |
Args |
2014-07-20 08:25:18 | mark.dickinson | set | recipients:
+ mark.dickinson, ronaldoussoren, ned.deily, wayedt |
2014-07-20 08:25:18 | mark.dickinson | set | messageid: <1405844718.59.0.799463159444.issue22012@psf.upfronthosting.co.za> |
2014-07-20 08:25:18 | mark.dickinson | link | issue22012 messages |
2014-07-20 08:25:18 | mark.dickinson | create | |
|