[Pyobjc-dev] endian bug in PyDocURLProtocol example
Brought to you by:
ronaldoussoren
From: Tom I. <to...@je...> - 2008-02-27 07:36:52
|
The function 'fourCharToInt' in PyDocEvents.py http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-framework-WebKit/Examples/PyDocURLProtocol/PyDocEvents.py uses struct.unpack without specifying the endianness of the unpack - it wants to be struct.unpack('>l', code)[0] or it won't work on intel machines. I haven't tested the example otherwise - I was merely cribbing it for writing my own URL handler. The way it mysteriously fails to work on intel machines while producing no error messages whatsoever is especially entertaining. Tom Insam to...@je... |