Message6374

Author lukas
Recipients lukas, pjenvey
Date 2011-01-31.08:13:29
SpamBayes Score 6.237625e-08
Marked as misclassified No
Message-id <1296461609.62.0.118159498079.issue1702@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Philip,
Thank you for your reply. It's not a particular issue for me at the moment, but more an very unexpected behavior (and I think this is for every developer who comes from CPython).
First of all, I would expect that two Python interpreters behave the same way, if they're interpreting the same code on the same machine. 
Second, if this is not the case, the doc should clearly say so (and even then this is really suboptimal).
But neither the doc to sys or struct does so. In the docs of struct, it's written "If the first character is not one of these, '@' is assumed. Native byte order is big-endian or little-endian, depending on the host system." and in the docs to sys.byteorder it says "An indicator of the native byte order. This will have the value 'big' on big-endian (most-significant byte first) platforms, and 'little' on little-endian (least-significant byte first) platforms.".
I think it is obvious, that this introduces a source for many subtle bugs, which are somewhat hard to find and may lead to serious data corruption.
Third, I don't see an obvious way to detect the endianness in pure Python (for which I thought sys.byteorder would be there).
History
Date User Action Args
2011-01-31 08:13:29lukassetmessageid: <1296461609.62.0.118159498079.issue1702@psf.upfronthosting.co.za>
2011-01-31 08:13:29lukassetrecipients: + lukas, pjenvey
2011-01-31 08:13:29lukaslinkissue1702 messages
2011-01-31 08:13:29lukascreate