"can't unpack IEEE 754 special value on non-IEEE platform"
I just ran the PIL test suite using the current Python trunk, and the tests for a user-contributed plugin raised an interesting exception: ValueError: can't unpack IEEE 754 special value on non-IEEE platform fixing this is easy, but the error is somewhat confusing: since when is a modern Intel CPU not an IEEE platform? </F>
[Fredrik Lundh]
I just ran the PIL test suite using the current Python trunk, and the tests for a user-contributed plugin raised an interesting exception:
ValueError: can't unpack IEEE 754 special value on non-IEEE platform
fixing this is easy, but the error is somewhat confusing: since when is a modern Intel CPU not an IEEE platform?
Which OS and compiler were in use? A possible cause is that the platform didn't supply #defines for SIZEOF_DOUBLE and/or SIZEOF_FLOAT when Python was compiled. This was, e.g., true on Windows before rev 46065. On an Intel box, you should see this:
float.__getformat__('double') 'IEEE, little-endian'
If you get 'unknown' instead, see above.
Tim Peters wrote:
Which OS and compiler were in use? A possible cause is that the platform didn't supply #defines for SIZEOF_DOUBLE and/or SIZEOF_FLOAT when Python was compiled. This was, e.g., true on Windows before rev 46065.
and looking again, I was indeed running 2.5 alpha 2 (revision 45740), not 2.5 trunk. oh well. </F>
Fredrik Lundh <fredrik@pythonware.com> writes:
I just ran the PIL test suite using the current Python trunk, and the tests for a user-contributed plugin raised an interesting exception:
ValueError: can't unpack IEEE 754 special value on non-IEEE platform
fixing this is easy, but the error is somewhat confusing: since when is a modern Intel CPU not an IEEE platform?
When it doesn't define SIZEOF_DOUBLE or maybe SIZEOF_FLOAT, IIRC. But I thought Tim fixed this, so I'm reduced to guessing again. Some questions that will help me help you: * What OS/compiler/etc? * What is the user plugin doing (i.e. is it C or Python)? * Any chance of a minimal example (if it's Python code, it'll be struct usage, most likely, if C, one of _PyFloat_Unpack{4,8} or something that calls one of those)? * What does [float.__getformat__(f) for f in ('float', 'double')] say? Cheers, mwh -- Just put the user directories on a 486 with deadrat7.1 and turn the Octane into the afforementioned beer fridge and keep it in your office. The lusers won't notice the difference, except that you're more cheery during office hours. -- Pim van Riezen, asr
participants (3)
-
Fredrik Lundh
-
Michael Hudson
-
Tim Peters