[
https://issues.apache.org/jira/browse/PROTON-490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mickael Maison updated PROTON-490:
----------------------------------
Attachment: 47_proton-490_fix_proton_init.patch
47_proton-490_fix_print_protocol.h.py.patch
47_proton-490_fix_print_encodings.h.py.patch
47_proton-490_fix_mllib_transforms.py.patch
47_proton-490_fix_mllib_parsers.patch
47_proton-490_fix_mllib_dom.patch
47_proton-490_fix_import_statements_mllib_init.patch
47_proton-490_fix_cproton.i.patch
I've worked out the changes needed to get the python bindings build with
python3.
The changes are:
- some C API calls in cproton.i
- imports in the mllib library
- calls to the print statement in encoding.h.py and protocol.h.py
- use of the long and unicode types in proton/__init__.py
I've tried to keep the changes as small as possible.
With all these changes I can successfully build and run the python bindings
with python 2 and 3.
There is one issue pending, documentation. Epydoc, which is the tool used
currently to generate the python documentation, doesn't work with python3. So
running "make all docs" will fail, you can only run "make all"
I suggest we open another bug to figure out what we want to do on the
documentation side. Sphinx seems to be the adopted tool for python3 but it will
require substantial changes.
> [proton-c] Python binding fails to link with Python 3 libraries
> ---------------------------------------------------------------
>
> Key: PROTON-490
> URL: https://issues.apache.org/jira/browse/PROTON-490
> Project: Qpid Proton
> Issue Type: New Feature
> Components: python-binding
> Affects Versions: 0.6
> Reporter: Ken Giusti
> Attachments: 47_proton-490_fix_cproton.i.patch,
> 47_proton-490_fix_import_statements_mllib_init.patch,
> 47_proton-490_fix_mllib_dom.patch, 47_proton-490_fix_mllib_parsers.patch,
> 47_proton-490_fix_mllib_transforms.py.patch,
> 47_proton-490_fix_print_encodings.h.py.patch,
> 47_proton-490_fix_print_protocol.h.py.patch,
> 47_proton-490_fix_proton_init.patch
>
>
> Attempting to link the Swig generated python bindings against the Python 3
> development libraries produces unresolved symbol errors:
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o: In function `_wrap_pn_bytes':
> pythonPYTHON_wrap.c:(.text+0xa567): undefined reference to
> `PyString_FromStringAndSize'
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o: In function
> `_wrap_pn_bytes_dup':
> pythonPYTHON_wrap.c:(.text+0xa701): undefined reference to
> `PyString_FromStringAndSize'
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o: In function
> `_wrap_pn_message_get_user_id':
> pythonPYTHON_wrap.c:(.text+0x1e827): undefined reference to
> `PyString_FromStringAndSize'
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o: In function
> `_wrap_pn_data_get_decimal128':
> pythonPYTHON_wrap.c:(.text+0x31450): undefined reference to
> `PyString_FromStringAndSize'
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o: In function
> `_wrap_pn_data_get_uuid':
> pythonPYTHON_wrap.c:(.text+0x31559): undefined reference to
> `PyString_FromStringAndSize'
> CMakeFiles/_cproton.dir/pythonPYTHON_wrap.c.o:pythonPYTHON_wrap.c:(.text+0x31664):
> more undefined references to `PyString_FromStringAndSize' follow
> collect2: error: ld returned 1 exit status
> This is due to a name change in the Python 3 API:
> http://docs.python.org/2/c-api/string.html?highlight=pystring_fromstring#PyString_FromStringAndSize
> http://docs.python.org/2/howto/cporting.html#conditional-compilation
> The wrapper C code in proton-c/bindings/python/python.i needs to be updated
> to support the Python 3 API.
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)