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.
Created on 2012年05月09日 13:51 by tshepang, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg160291 - (view) | Author: Tshepang Lekhonkhobe (tshepang) * | Date: 2012年05月09日 13:51 | |
This example [1] assumes you are using a specific platform to check it out. I am using amd64, and I get different results. To fix, I prefix the format string with '>':
before:
pack('hhl', 1, 2, 3)
after:
pack('>hhl', 1, 2, 3)
1: http://hg.python.org/cpython/file/d3ddbad31b3e/Doc/library/struct.rst#l299
|
|||
| msg160292 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2012年05月09日 14:07 | |
And the examples make an explicit note of that: """ .. note:: All examples assume a native byte order, size, and alignment with a big-endian machine. """ AMD64 is little-endian; the examples are noted to be in big-endian. Is that note not sufficient? |
|||
| msg160293 - (view) | Author: Tshepang Lekhonkhobe (tshepang) * | Date: 2012年05月09日 14:11 | |
Sadly, I noticed it only after submitting this report. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:30 | admin | set | github: 58970 |
| 2012年05月09日 14:15:14 | meador.inge | set | status: open -> closed resolution: not a bug stage: resolved |
| 2012年05月09日 14:11:21 | tshepang | set | messages: + msg160293 |
| 2012年05月09日 14:07:14 | meador.inge | set | messages: + msg160292 |
| 2012年05月09日 13:51:51 | tshepang | create | |