FS#64736 - [virtualbox] Python binding does not work since python3.8 update

Attached to Project: Community Packages
Opened by kmille (kmille) - Wednesday, 04 December 2019, 22:09 GMT
Last edited by Christian Hesse (eworm) - Friday, 13 December 2019, 10:24 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Christian Hesse (eworm)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hey,
what I'm trying to do::

kmille@linbox py3status% head vms.py
# -*- coding: utf-8 -*-
from virtualbox.library import MachineState
from virtualbox import VirtualBox

vbox = VirtualBox()


kmille@linbox py3status% python --version
Python 3.8.0
kmille@linbox py3status% python vms.py
m=VBoxPython3_8 x=No module named 'VBoxPython3_8'
m=VBoxPython3 x=No module named 'VBoxPython3'
m=VBoxPython x=No module named 'VBoxPython'
Traceback (most recent call last):
File "vms.py", line 5, in <module>
vbox = VirtualBox()
File "/home/kmille/.local/lib/python3.8/site-packages/virtualbox/library_ext/vbox.py", line 22, in __init__
manager = virtualbox.Manager()
File "/home/kmille/.local/lib/python3.8/site-packages/virtualbox/__init__.py", line 145, in __init__
self.manager = vboxapi.VirtualBoxManager(mtype, mparams)
File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 989, in __init__
self.platform = PlatformXPCOM(dPlatformParams)
File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 750, in __init__
import xpcom.vboxxpcom
File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py", line 79, in <module>
raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),))
Exception: Cannot find VBoxPython module (tried: VBoxPython3_8, VBoxPython3, VBoxPython)


So basically the code is trying to import VBoxPython3_8.so, VBoxPython3.so or VBoxPython.so. But none of the files are part of the virtualbox or virtualbox-sdk package. The problem exists since the python3 update from 3.7 to 3.8 on Arch Linux. I was trying to build Virtualbox from scratch but I can't find the problem.

I first tried this (https://github.com/ciarancourtney/build-virtualbox-docker/blob/master/Dockerfile) which gave me the following files:

root@8554bacc30ba:/VirtualBox/out/linux.amd64/release/obj# find .| grep Python | grep so$
./VBoxPython/VBoxPython.so
./VBoxPython3_6m/VBoxPython3_6m.so

If I build it manually on my Arch based on your PKGBUILD I just get the bindings for 2.7:
kmille@linbox obj master % find .| grep Python | grep so$
./VBoxPython/VBoxPython.so
./VBoxPython2_7/VBoxPython2_7.so

Does the python3 binding work for you?

If you need any help to reproduce the issue please just ask.
This task depends upon

Closed by  Christian Hesse (eworm)
Friday, 13 December 2019, 10:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  virtualbox 6.1.0-1
Comment by kmille (kmille) - Monday, 09 December 2019, 21:21 GMT
does this work for you?

kmille@linbox ~% pacman -Qo /usr/lib/virtualbox/vboxshell.py
/usr/lib/virtualbox/vboxshell.py is owned by virtualbox-sdk 6.0.14-4
kmille@linbox ~% which python
/usr/bin/python
kmille@linbox ~% python --version
Python 3.8.0
kmille@linbox ~% python /usr/lib/virtualbox/vboxshell.py
m=VBoxPython3_8 x=No module named 'VBoxPython3_8'
m=VBoxPython3 x=No module named 'VBoxPython3'
m=VBoxPython x=No module named 'VBoxPython'
Traceback (most recent call last):
File "/usr/lib/virtualbox/vboxshell.py", line 3617, in <module>
main(sys.argv)
File "/usr/lib/virtualbox/vboxshell.py", line 3585, in main
oVBoxMgr = VirtualBoxManager(style, params)
File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 989, in __init__
self.platform = PlatformXPCOM(dPlatformParams)
File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 750, in __init__
import xpcom.vboxxpcom
File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py", line 79, in <module>
raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),))
Exception: Cannot find VBoxPython module (tried: VBoxPython3_8, VBoxPython3, VBoxPython)
Comment by Christian Hesse (eworm) - Friday, 13 December 2019, 09:44 GMT
Is this still an issue with virtualbox 6.1.0-1?
Comment by kmille (kmille) - Friday, 13 December 2019, 10:21 GMT
Hey,
indeed, works with virtualbox 6.1.0-1. But do you know why?

Basically because these files are there:
kmille@linbox py3status% pacman -Ql virtualbox | grep Python
virtualbox /usr/lib/virtualbox/VBoxPython.so
virtualbox /usr/lib/virtualbox/VBoxPython3_8.so

But I can not find the change in the PKGBUILD [0]

Greetings

kmille

[0] https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/virtualbox&id=c35beadf3b99dc224b7e7fc6df2d7a283b5499e9
Comment by Christian Hesse (eworm) - Friday, 13 December 2019, 10:23 GMT
There are no changes in PKGBUILD regarding this issue. It was an upstream one.

Loading...