Although I am just having a dialogue with myself here, I finallyJust use lzo.decompress(data,False,out_len,alogrithm="XYZ")
figured out what the problem is:-) (I cannot solve my problem, but now
I at least know what it is)
The lzo python bindings does not return the exact same array of bytes
as the C-library functions. They add a header, where the first byte is
0xF= for LZO-1X compr lvl 1, and then an uint 32 representing the
number of bytes in the *uncompressed* byet array. Apparently, this convenience information is used in the Python binding uncompress
function, to allocate the right sized buffer for the output prior to
calling the lzo library uncompress function. Really crap binding code
if you ask me as it measn that I have to know *in advance* how many
bytes a compressed array of bytes will unpack into *prior* to calling lzo.uncompress. And if it is compressed data from another data source,
it is really not possible to know that final data size beforehand,
which is...crap.
lzo.decompress(data,False,out_len,alogrithm="XYZ")
this does not work. Shows the error: decompress() takes no keyword arguments
Also, the function only takes 3 arguments. Running lzo.decompress(c,
False, 512, "LZO1Z") gives the error: function takes at most 3
arguments (4 given)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (2 / 14) |
Uptime: | 133:59:18 |
Calls: | 5,524 |
Calls today: | 1 |
Files: | 11,671 |
Messages: | 5,095,210 |