To: vim_dev@googlegroups.com Subject: Patch 8.2.0068 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///