wdq89 / py-leveldb

Automatically exported from code.google.com/p/py-leveldb
Other
0 stars 0 forks source link

Current implementation compatible with Python 2.7 only #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Get a lot of errors when try to build with older versions of Python (tested 
with 2.4, 2.5 and 2.6). Is it possible to make it compatible with older python 
versions ?

Original issue reported on code.google.com by galtsevdv@gmail.com on 13 Aug 2011 at 2:04

GoogleCodeExporter commented 8 years ago
2.6 is easy I think. I´ll investigate the others.

Original comment by arnim...@gmail.com on 13 Aug 2011 at 3:39

GoogleCodeExporter commented 8 years ago
Just committed changes to support Python 2.4, 2.5 and 2.6. Will attempt 
3.0/3.1/3.2 later, and leaving the issue open until then.

Original comment by arnim...@gmail.com on 15 Aug 2011 at 9:08

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Not working for python 2.4 since it lookis Py_ssize_t only get defined after 
python 2.5.

$ python setup.py build       
running build
running build_py
package init file '__init__.py' not found (or not a regular file)
package init file '__init__.py' not found (or not a regular file)
running build_ext
building 'leveldb' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-I/usr/include/python2.4 -c leveldb_ext.cc -o 
build/temp.linux-x86_64-2.4/leveldb_ext.o -I./leveldb-read-only/include -fPIC 
-Wall -g2 -D_GNU_SOURCE -O2 -DNDEBUG
leveldb_ext.h:39: error: '˜Py_ssize_t' does not name a type
leveldb_ext.h:42: error: 'Py_ssize_t' does not name a type
error: command 'gcc' failed with exit status 1

the patch below worked...on Linux version 2.6.18-128.7.1.el5(gcc version 4.1.2)
$ svn diff
Index: leveldb_ext.h
===================================================================
--- leveldb_ext.h       (revision 38)
+++ leveldb_ext.h       (working copy)
@@ -26,6 +26,10 @@
 PyObject* leveldb_repair_db(PyObject* o, PyObject* args);
 PyObject* leveldb_destroy_db(PyObject* o, PyObject* args);

+#if (PY_VERSION_HEX < 0x02050000) 
+typedef size_t Py_ssize_t ;
+#endif
+
 typedef struct {
        PyObject_HEAD

Original comment by lob...@gmail.com on 20 Dec 2011 at 6:56

GoogleCodeExporter commented 8 years ago
My bad. There was a regression. Should be working fine now.

Original comment by arnim...@gmail.com on 20 Dec 2011 at 10:22