python libclang bindings on Windows fail to initialize a translation unit from sublime text -


short description: using libclang autocomplete code not work python comes bundled sublime text 3.

details: small verifiable example in repo on github

in essence, there script uses changed cindex.py (compatible python 3 , clang 3.8) , builds translation unit test source file. reparses , tries complete.

the script works expected on using python 3.3.5 powershell.

when put packages folder on sublime text 3 produces error. python version reported sublime text 3 3.3.6. error:

traceback (most recent call last):   file "c:\program files\sublime text 3\sublime_plugin.py", line 78, in reload_plugin     m = importlib.import_module(modulename)   file "./python3.3/importlib/__init__.py", line 90, in import_module   file "<frozen importlib._bootstrap>", line 1584, in _gcd_import   file "<frozen importlib._bootstrap>", line 1565, in _find_and_load   file "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked   file "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper   file "<frozen importlib._bootstrap>", line 1022, in load_module   file "<frozen importlib._bootstrap>", line 1003, in load_module   file "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper   file "<frozen importlib._bootstrap>", line 868, in _load_module   file "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed   file "c:\users\igor\appdata\roaming\sublime text 3\packages\test_clang\script.py", line 21, in <module>     tu = tu.from_source(filename=filename)   file "c:\users\igor\appdata\roaming\sublime text 3\packages\test_clang\clang\cindex38.py", line 2372, in from_source     raise translationunitloaderror("error parsing translation unit.") clang.cindex38.translationunitloaderror: error parsing translation unit. 

this happening because ptr tranlation unit returned libclang inside cindex.py none. thing strange me happens python bundled sublime text 3.

does happen other people? have idea cause or how debug it?

also feel free ping me if cannot run example provided here.

upd: in issues of test project have found out not ctypes bundled in sublime text. replacing ones sublime text ones installed in system produces same error.

upd2: have stripped down cindex.py file in test repository contain bare minimum of code needed run same issue described in question. maybe generating new ideas on can wrong? also, want explicitly point out same code works expected on both linux , osx.

unfortunately answer question is due bug in python 3.3 bundled sublime text 3. see discussion on sublime text forum.

this means won't see fix until whenever version of sublime text comes newer python bundled within it.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -