Bug 750889 - Python code incompatible with Python v3.
Summary: Python code incompatible with Python v3.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-02 17:24 UTC by Neil Wilson
Modified: 2012-05-02 15:49 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-05-02 15:49:04 UTC
Embargoed:


Attachments (Terms of Use)

Description Neil Wilson 2011-11-02 17:24:31 UTC
Description of problem:

The python interface code is version 2 specific - many of the Api calls made are not available in the Python 3 libraries.

Version-Release number of selected component (if applicable):


How reproducible:

Compile the code under the Python3 development environment.

  
Actual results:

../../../python/guestfs-py.h: In function 'put_handle':
../../../python/guestfs-py.h:58:5: warning: implicit declaration of function 'PyCObject_FromVoidPtrAndDesc' [-Wimplicit-function-declaration]
../../../python/guestfs-py.h:57:3: warning: return makes pointer from integer without a cast [enabled by default]
../../../python/guestfs-py.c: In function 'get_string_list':
../../../python/guestfs-py.c:56:5: warning: implicit declaration of function 'PyString_AsString' [-Wimplicit-function-declaration]
../../../python/guestfs-py.c:56:10: warning: assignment makes pointer from integer without a cast [enabled by default]
Function `PyString_AsString' implicitly converted to pointer at ../../../python/guestfs-py.c:56
../../../python/guestfs-py.c: In function 'put_string_list':
../../../python/guestfs-py.c:73:5: warning: implicit declaration of function 'PyString_FromString' [-Wimplicit-function-declaration]
../../../python/guestfs-py.c:73:5: warning: passing argument 3 of 'PyList_SetItem' makes pointer from integer without a cast [enabled by default]
/usr/include/python3.2mu/listobject.h:55:17: note: expected 'struct PyObject *' but argument is of type 'int'
../../../python/guestfs-py.c: In function 'put_table':
../../../python/guestfs-py.c:90:5: warning: passing argument 3 of 'PyTuple_SetItem' makes pointer from integer without a cast [enabled by default]
/usr/include/python3.2mu/tupleobject.h:46:17: note: expected 'struct PyObject *' but argument is of type 'int'
../../../python/guestfs-py.c:91:5: warning: passing argument 3 of 'PyTuple_SetItem' makes pointer from integer without a cast [enabled by default]
/usr/include/python3.2mu/tupleobject.h:46:17: note: expected 'struct PyObject *' but argument is of type 'int'
../../../python/guestfs-py.c: In function 'put_lvm_pv':
../../../python/guestfs-py.c:128:25: warning: passing argument 3 of 'PyDict_SetItemString' makes pointer from integer without a cast [enabled by default]
/usr/include/python3.2mu/dictobject.h:156:17: note: expected 'struct PyObject *' but argument is of type 'int'


etc, etc.


Expected results:


Additional info:

Comment 2 Richard W.M. Jones 2011-11-02 17:31:23 UTC
These refs look useful ...

http://docs.python.org/release/3.0.1/whatsnew/3.0.html
http://python3porting.com/cextensions.html

Comment 5 Richard W.M. Jones 2012-05-02 15:49:04 UTC
The fix has been included upstream for a while, closing.


Note You need to log in before you can comment on or make changes to this bug.