--- setup.py.py23 2009-02-26 19:49:41.000000000 +0100
+++ setup.py 2009-03-03 12:28:11.000000000 +0100
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-import sys, os, subprocess
from warnings import warn
from setuptools import setup, Extension
@@ -44,16 +44,17 @@ compile_args = []
warnflags = ['-Wall', '-Wextra', '-pedantic', '-Wswitch-enum', '-Wswitch-default']
compile_args.extend(warnflags)
-if not subprocess.Popen('touch gnu99-test.c; gcc -std=gnu99 -E gnu99-test.c > /dev/null; rm -f gnu99-test.c',
- shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True).stdout.read():
+if not os.popen('touch gnu99-test.c; gcc -std=gnu99 -E gnu99-test.c > /dev/null; rm -f gnu99-test.c').read():
compile_args.append('-std=gnu99')
-pc_cflags = subprocess.Popen("pkg-config --cflags liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip()
+pc_cflags = os.popen("pkg-config --cflags liblzma").readline().strip()
compile_args.extend(pc_cflags.split(' '))
-pc_libs = subprocess.Popen("pkg-config --libs liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip()
+pc_libs = os.popen("pkg-config --libs liblzma").readline().strip()
link_args.extend(pc_libs.split(' '))
+ link_args.append('-llzma')
extens=[Extension('lzma', c_files, extra_compile_args=compile_args, extra_link_args=link_args, define_macros=version_define)]
=== modified file 'src/liblzma.c'
--- src/liblzma.c 2010-04-13 21:05:20 +0000
+++ src/liblzma.c 2010-08-05 12:40:10 +0000
LZMA_compress(__attribute__((unused)) PyObject *self, PyObject *args, PyObject *kwargs)
PyObject *ret = NULL, *options_dict = NULL;
Py_ssize_t datasize, bufsize;
static char *kwlist[] = {"input", "options", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|O:compress", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:compress", kwlist,
+ (char **) &data, &datasize, &options_dict))
filters[0].options = &options;
if(!init_lzma_options("compress", options_dict, filters))