[issue6715] xz compressor support
Amaury Forgeot d'Arc
report at bugs.python.org
Thu Oct 28 01:40:43 CEST 2010
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
As promised, here is a quick review of the module.
https://code.launchpad.net/~proyvind/pyliblzma/py3k looks ready for a new entry in the PyPI, but for inclusion in core python it needs some cleanup:
- I suppose that src/pyliblzma.c is the only interesting file. In CPython it will be named Modules/lzmamodule.c
- There are some calls to malloc(), calloc() and free() that are incorrect (there is even a call to free() on a PyObject*!); in any case, functions like PyMem_Malloc() are preferred.
- please don't use alloca (and it has another name on Windows)
- snprintf is not available everywhere; use PyOS_snprintf instead.
- The module does not compile on Windows: types like uint8_t don't exist, __attribute__((unused)) is GCC-specific.
- Don't use PyBytesObject*; PyObject* is enough and avoids many casts.
- PyLong_FromLong(LZMA_FILTER_LZMA1) truncates the value on 32bit platforms
- You could use LZMA_VERSION_STRING to fill the version attribute.
Also, I did not find any documentation.
Otherwise the code follows CPython conventions and is easy to read. Good job!
3.2beta1 is scheduled for November 13, 2010, and no new feature will be accepted after. Do you think you can update it before the limit? otherwise the package could live in PyPI before it is shipped with Python.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list