I was trying to run a build report and I started to get failures parsing binary 
Depex files. I tracked it down to struct.unpack("LHHBBBBBBBB", 
DepexFile.read(16))  throwing an error that the size required was 20 not 16. 

After digging around I found out that struct.calcsize ("L") == 8 for 64-bit 
version of Python, so the Python documentation is misleading about the sizeof 
"L". It looks like "I" is a more portable way to represent a 32-bit number. 

~/edk2(master)>python
Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.calcsize ("L")
8
>>> struct.calcsize ("I")
4

Thanks,

Andrew Fish






------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-buildtools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel

Reply via email to