Message212416
This code did something unexpected to me:
>>> a = bytearray('1234')
>>> a
bytearray(b'1234')
>>> struct.pack_into('xBxB', a, 0, 0x59, 0x5A)
>>> a
bytearray(b'\x00Y\x00Z')
The unexpected part was that the 'x' pad byte formatter actually *overwrote* the bytes to 0 rather than leaving them alone.
Not necessarily a bug, but the fact that the pad byte writes 0x00 rather than being untouched/ignored should be documented. |
|
Date |
User |
Action |
Args |
2014-02-28 09:17:29 | bsder | set | recipients:
+ bsder |
2014-02-28 09:17:29 | bsder | set | messageid: <1393579049.39.0.501282349647.issue20803@psf.upfronthosting.co.za> |
2014-02-28 09:17:29 | bsder | link | issue20803 messages |
2014-02-28 09:17:28 | bsder | create | |
|