coolzhao / py-leveldb

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

Python 3 support #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I've tried to build python-leveldb on Debian, the result is shown below:

python3.2 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
creating build
creating build/temp.linux-x86_64-3.2
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g 
-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security 
-Werror=format-security -fPIC -I/usr/include/python3.2mu -c leveldb_ext.cc -o 
build/temp.linux-x86_64-3.2/leveldb_ext.o -I./leveldb/include -fPIC -Wall -g2 
-D_GNU_SOURCE -O2 -DNDEBUG
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC 
but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC 
but not for C++ [enabled by default]
leveldb_ext.cc: In function 'PyObject* initleveldb()':
leveldb_ext.cc:18:80: error: 'Py_InitModule3' was not declared in this scope
leveldb_ext.cc:21:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:24:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:27:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:30:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:36:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:41:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:46:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:52:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:57:3: error: return-statement with no value, in function 
returning 'PyObject* {aka _object*}' [-fpermissive]
leveldb_ext.cc:58:1: warning: no return statement in function returning 
non-void [-Wreturn-type]
error: command 'gcc' failed with exit status 1
make[1]: *** [build-python3.2] Error 1

Would you please add the support for Python 3?
Thanks in advance.

Original issue reported on code.google.com by quadris...@gmail.com on 15 May 2012 at 6:34

GoogleCodeExporter commented 9 years ago
I have a preliminary patch which I haven't committed yet.

Just curious, since I'm not too familiar with peoples's usage of Python 3. Are 
3.0 and 3.1 of much importance?

Original comment by arnim...@gmail.com on 15 May 2012 at 9:51

GoogleCodeExporter commented 9 years ago
It doesn't matter much, even 3.0 would be good.

Original comment by quadris...@gmail.com on 17 May 2012 at 7:51

GoogleCodeExporter commented 9 years ago
Tested latest commit on Python 2.4 through 3.2.

Original comment by arnim...@gmail.com on 4 Jun 2012 at 5:56

GoogleCodeExporter commented 9 years ago
It works like a charm, thank you so much!

Original comment by quadris...@gmail.com on 14 Jun 2012 at 9:15