Traceback (most recent call last):
File "c:\Users\user\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\user\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\lib\python\ptvsd\__main__.py", line 410, in main
run()
File "c:\Users\user\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\lib\python\ptvsd\__main__.py", line 291, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\user\Documents\Python Scripts\AstraSProductFlow\test_filter.py", line 6, in <module>
device = openni2.Device(ONI_VIDEO_PATH)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\site-packages\openni\openni2.py", line 223, in __init__
self._reopen()
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\site-packages\openni\openni2.py", line 233, in _reopen
c_api.oniDeviceOpen(self._orig_uri, ctypes.byref(self._handle))
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\site-packages\openni\_openni2.py", line 2826, in wrapper
res = func(*args)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\AstraS\lib\site-packages\openni\_openni2.py", line 2901, in oniDeviceOpen
return _oniDeviceOpen(uri, pDevice)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
Suggested working correction for the open_file method:
File openni2.py line 262
From
return cls(filename)
to
return cls(filename.encode('utf-8'))
Problem: .ONI files can't be opened neither using the filename as the path neither using the Device.open_file() method.
Sample Code:
Alternative method that also fails:
Error log:
Suggested working correction for the open_file method: File openni2.py line 262 From
return cls(filename)
toreturn cls(filename.encode('utf-8'))