Bug Report - Spatial vs python vs windows

Supporting 2.7 and 3.2+
mrdale1958
Fresh meat
Posts: 3
Joined: Mon Apr 25, 2016 10:27 pm
Contact:

Bug Report - Spatial vs python vs windows

Postby mrdale1958 » Mon Apr 25, 2016 10:41 pm

I'm trying to run python code for spatial that I have successfully run on OSX and Android on Windows 10 but both my code and the spatial-simple.py example code kill python mysteriously soon after attaching the Spatial device. In all cases I've been running python 3.5 (because I'm using asyncio)

On a whim I tried the spatial example on python 2.7 and see that it throws a ValueError (but doesn't kill python) on line 554 of Spatial.py in _nativeSpatialDataEvent
if data[0].acceleration[0] == 1e300:
ValueError: NULL pointer access

The spatial-full application works fine. Is python somehow accessing a different library?

mrdale1958
Fresh meat
Posts: 3
Joined: Mon Apr 25, 2016 10:27 pm
Contact:

Re: Bug Report - Spatial vs python vs windows

Postby mrdale1958 » Tue Apr 26, 2016 3:49 am

A bit more investigation reveals that in python 2.7
line 553 of Spatial.py

Code: Select all

            data2 = cast(data[i], POINTER(CPhidgetSpatial_SpatialEventData))

results in a structure that throws a ValueError when data2[0] is accessed when (and as far as I can tell only when) i=1

in python 3.5 the same code results in a structure that breaks python when data2[0] is accessed and i=0. Even if I wrap the loop in a try/except the access crashes python rather than catching whatever the exception is.

Again this is all Windows 10 Home


Return to “Python”

Who is online

Users browsing this forum: No registered users and 4 guests