Patch 8.2.0068

19 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 31, 2019, 3:59:51 PM12/31/19
to vim...@googlegroups.com

Patch 8.2.0068
Problem: Crash when using Python 3 with "utf32" encoding. (Dominique Pelle)
Solution: Use "utf-8" whenever enc_utf8 is set. (closes #5423)
Files: src/testdir/test_python3.vim, src/if_py_both.h


*** ../vim-8.2.0067/src/testdir/test_python3.vim 2019-12-11 20:10:33.000000000 +0100
--- src/testdir/test_python3.vim 2019-12-31 21:58:46.183387534 +0100
***************
*** 167,169 ****
--- 167,176 ----
call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
endtry
endfunc
+
+ func Test_unicode()
+ " this crashed Vim once
+ set encoding=utf32
+ py3 print('hello')
+ set encoding=utf8
+ endfunc
*** ../vim-8.2.0067/src/if_py_both.h 2019-11-30 18:38:40.000000000 +0100
--- src/if_py_both.h 2019-12-31 21:57:27.515684413 +0100
***************
*** 19,25 ****
typedef int Py_ssize_t; // Python 2.4 and earlier don't have this type.
#endif

! #define ENC_OPT ((char *)p_enc)
#define DOPY_FUNC "_vim_pydo"

static const char *vim_special_path = "_vim_path_";
--- 19,25 ----
typedef int Py_ssize_t; // Python 2.4 and earlier don't have this type.
#endif

! #define ENC_OPT (enc_utf8 ? "utf-8" : (char *)p_enc)
#define DOPY_FUNC "_vim_pydo"

static const char *vim_special_path = "_vim_path_";
*** ../vim-8.2.0067/src/version.c 2019-12-31 21:27:09.555256491 +0100
--- src/version.c 2019-12-31 21:58:12.059516041 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 68,
/**/

--
Be nice to your kids... they'll be the ones choosing your nursing home.

/// 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 ///

Dominique Pellé

unread,
Dec 31, 2019, 5:15:15 PM12/31/19
to vim_dev
Bram Moolenaar wrote:

> Patch 8.2.0068
> Problem: Crash when using Python 3 with "utf32" encoding. (Dominique Pelle)
> Solution: Use "utf-8" whenever enc_utf8 is set. (closes #5423)
> Files: src/testdir/test_python3.vim, src/if_py_both.h
> For more information, visit http://www.vim.org/maillist.php

Thanks. That fixes the case I reported with
enc=utf32 or utf16. However, vim-8.2.69 still
crashes with:

$ vim --clean -c'set enc=debug' -c'py3 1'
or
$ vim --clean -c'set enc=euc-tw -c'py3 1'

which gives:

Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault (core dumped)

Regards
Dominique

Bram Moolenaar

unread,
Jan 1, 2020, 8:57:10 AM1/1/20
to vim...@googlegroups.com, Dominique Pellé
Hmm, so "euc-jp" works but "euc-tw" doesn't. How are we supposed to
know that?

When enc_dbcs is set we can use "euc-jp", because it appears to work.
It's not quite right though.

--
ARTHUR: Listen, old crone! Unless you tell us where we can buy a shrubbery,
my friend and I will ... we will say "Ni!"
CRONE: Do your worst!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Reply all
Reply to author
Forward
0 new messages