jaxbot / github-issues.vim

Github issue lookup in Vim
http://jaxbot.me/articles/github-issues-vim-plugin-5-7-2014
Other
405 stars 28 forks source link

Support Python 2 or 3 #163

Closed zeekay closed 6 years ago

zeekay commented 6 years ago

Lightly updated version of older fork.

Fubukimaru commented 6 years ago

I have installed this version, however I get the following error when using :Gissues :

Error detected while processing function <SNR>18_showGithubIssues:
line    5:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 215, in showIssueList
  File "<string>", line 130, in getUpstreamRepoURI
  File "<string>", line 98, in getRepoURI
TypeError: a bytes-like object is required, not 'str'

Any clues? Running Ubuntu 16.04 and using vim.gtk package. Python 3 version: Python 3.5.2 (default, Nov 23 2017, 16:37:01) Python 2 works properly.

Fubukimaru commented 6 years ago

I have tested the updates and it works partially.

It throws an error when showing an issue on Ubuntu 18.04, Python 3.6.5 and vim 8.0.

Error detected while processing function <SNR>19_showIssue:
line    6:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 613, in showIssueBuffer
vim.error: Vim(python3):Traceback (most recent call last):
E171: Missing :endif
Fubukimaru commented 6 years ago

Found the problem: a = "This is a test: " b = str("and it works").encode("utf-8") a+b

Python 2: 'This is a test: and it works'

Python 3: Traceback (most recent call last): File "", line 1, in TypeError: must be str, not bytes

We need a workaround to all the .encode() that are present in the python for this to work.

Fubukimaru commented 6 years ago

Fixed the issues I had here: https://github.com/jaxbot/github-issues.vim/pull/172

There were some adaptations to python 3 missing (at least for python 3.6.5).

osleg commented 6 years ago

Implemented in #172