derekelkins / agda-vim

Agda interaction in vim
BSD 2-Clause "Simplified" License
130 stars 47 forks source link

Fix the Typerror by decoding the include paths #53

Closed GustavoMF31 closed 4 years ago

GustavoMF31 commented 4 years ago

Using "\"-i\"," + ",\"-i\",".join(vim.vars['agdavim_agda_includepathlist']) to create the command for searching in the extra include paths was causing TypeError: sequence item 0: expected str instance, bytes found, because vim.vars returns a bytes object. This was preventing agda-vim, the python3 one by 1000000000, from working properly for me (I was getting "Goal not loaded" for everything i tried). I fixed it by mapping lambda x : x.decode() over the result of vim.vars, and it seems to work fine now. I've read somewhere that this might raise an Exception in the case the bytes aren't proper utf-8 byte sequences, so maybe some sort of handling should be added. This is my first pull request ever, so, sorry if i made any dumb mistakes.

GustavoMF31 commented 4 years ago

Oh, i've just seen the comment from derekelkins on the pull request for the python 3 version explaining this issue and describing other problems with it. I guess that needs to be fixed before any of this can be merged, so i will close this. I will keep using the python 3 version and report any bugs i find in that pr.