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 SchorschMCMLX, mark.dickinson
Date 2011-09-03.07:22:44
SpamBayes Score 2.8096137e-11
Marked as misclassified No
Message-id <1315034565.89.0.757336924861.issue12889@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with you on the correct 8 output bytes.  And those expected bytes are exactly what struct.pack is producing here:

Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul  3 2011, 15:40:35) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "packages", "demo" or "enthought" for more information.
>>> import struct
>>> struct.pack('!d', 1.2345)
'?\xf3\xc0\x83\x12n\x97\x8d'
>>> len(struct.pack('!d', 1.2345))
8
>>> struct.pack('!d', 1.2345).encode('hex')
'3ff3c083126e978d'

I suspect that the confusion arises from the way the output string is displayed:  the 8 bytes in the output string are escaped if they're not printable ASCII characters, and are displayed directly otherwise (notice the '?' and the 'n', with codes 0x3f and 0x63 respectively).
History
Date User Action Args
2011-09-03 07:22:46mark.dickinsonsetrecipients: + mark.dickinson, SchorschMCMLX
2011-09-03 07:22:45mark.dickinsonsetmessageid: <1315034565.89.0.757336924861.issue12889@psf.upfronthosting.co.za>
2011-09-03 07:22:45mark.dickinsonlinkissue12889 messages
2011-09-03 07:22:44mark.dickinsoncreate