I made a patch to fix some bugs related to Vim's Python3 support. The
bugs I found are:
* vim.error is a `str` instead of an `Exception` object, so `except` or
`raise` it causes a `SystemError` exception
* buffer objects do not support slice assignment
* when exchange text between Vim and Python, multibyte texts become
gabage or cause Unicode Expceptions, etc
* `py3file` tries to read in the file as Unicode, sometimes causes
UnicodeDecodeException
The patch works on my Ubuntu Linux 32bit and Windows XP SP3 and should
apply to any Vim 7.3+ version.
--
Best regards,
lilydjwg
Linux Vim Python 我的博客
http://lilydjwg.is-programmer.com/
> I made a patch to fix some bugs related to Vim's Python3 support. The
> bugs I found are:
>
> * vim.error is a `str` instead of an `Exception` object, so `except` or
> `raise` it causes a `SystemError` exception
> * buffer objects do not support slice assignment
> * when exchange text between Vim and Python, multibyte texts become
> gabage or cause Unicode Expceptions, etc
> * `py3file` tries to read in the file as Unicode, sometimes causes
> UnicodeDecodeException
>
> The patch works on my Ubuntu Linux 32bit and Windows XP SP3 and should
> apply to any Vim 7.3+ version.
Sounds good.
Can a few people try this out?
--
Apologies for taking up the bandwidth with the apology. Anything else I
can apologise for ...... er no can't think of anything, sorry about that.
Andy Hunt (Member of British Olympic Apology Squad)
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
> I made a patch to fix some bugs related to Vim's Python3 support. The
> bugs I found are:
>
> * vim.error is a `str` instead of an `Exception` object, so `except` or
> `raise` it causes a `SystemError` exception
> * buffer objects do not support slice assignment
> * when exchange text between Vim and Python, multibyte texts become
> gabage or cause Unicode Expceptions, etc
> * `py3file` tries to read in the file as Unicode, sometimes causes
> UnicodeDecodeException
>
> The patch works on my Ubuntu Linux 32bit and Windows XP SP3 and should
> apply to any Vim 7.3+ version.
I have included the patch, but on my Ubuntu system I get this error:
E448: Could not load library function PyUnicode_UCSX_*
when doing something simple as ":py3 print('hello')"
Can you fix that?
--
If Microsoft would build a car...
... Occasionally your car would die on the freeway for no
reason. You would have to pull over to the side of the road,
close all of the car windows, shut it off, restart it, and
reopen the windows before you could continue. For some reason
you would simply accept this.
Yes, just a typo preventing Python symbols from loading.
Later a user found that there was heavy memory leakage, and I tried hard
to fix them. It was partly introduced by my code, and I believe partly
had been there before. Attached patch should fix this too.
--
Best regards,
lilydjwg
Thanks for the update. I'll check it out later.
I have this remark in the todo list, I suppose this patch is fixing it:
Python3 interface doesn't handle utf-8 correctly? (Nov 2010, lilydjwg)
--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.
Yes.
--
Best regards,
lilydjwg
Linux Vim Python 我的博客
http://bit.ly/lilydjwg or http://goo.gl/y4Gsy