Opened 7 years ago
#17448 new defect
Python bindings for Python 3.x fail on sys.abiflag() because of module and init name mismatch
Reported by: | SethMichaelLarson | Owned by: | |
---|---|---|---|
Component: | VM control | Version: | VirtualBox 5.2.4 |
Keywords: | vboxapi | Cc: | |
Guest type: | all | Host type: | all |
Description
Reporting an issue where if sys.abiflags() != ''
you will not be able to import vboxapi on Python 3.x systems because of how the PyInit function is named.
Python requires .so modules to have an exported function with the name PyInit_[MODULE NAME]
and in this case when the user installed via the .deb
file for Ubuntu 16.04 the .so file was named VBoxPython3_5m.so
but when examining the exported function names we received only PyInit_VBoxPython3_5
(note that there is no m
at the end).
This mismatch makes it tough for users to install vboxapi without having to take additional steps such as renaming their .so file to not include the m
.
Source file where this PyInit function is generated: https://www.virtualbox.org/svn/vbox/trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
See https://github.com/mjdorma/pyvbox/issues/102 for the original issue reported by another user.