To: vim_dev@googlegroups.com Subject: Patch 8.2.1790 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1790 Problem: MS-Windows with Python: crash when executed from Vifm. Solution: Use NUL instead of CONIN. (Ken Takata, closes #7061, closes #7053) Files: src/if_python3.c *** ../vim-8.2.1789/src/if_python3.c 2020-08-06 21:47:05.588778669 +0200 --- src/if_python3.c 2020-10-03 13:55:04.301439280 +0200 *************** *** 909,915 **** #if defined(MSWIN) && (PY_VERSION_HEX >= 0x030500f0) // Python 3.5 or later will abort inside Py_Initialize() when stdin is ! // redirected. Reconnect stdin to CONIN$. // Note that the python DLL is linked to its own stdio DLL which can be // differ from Vim's stdio. static void --- 909,915 ---- #if defined(MSWIN) && (PY_VERSION_HEX >= 0x030500f0) // Python 3.5 or later will abort inside Py_Initialize() when stdin is ! // redirected. Reconnect stdin to NUL. // Note that the python DLL is linked to its own stdio DLL which can be // differ from Vim's stdio. static void *************** *** 938,948 **** pyfreopen = (void*)GetProcAddress(hpystdiodll, "freopen"); } ! // Reconnect stdin to CONIN$. if (pyfreopen) ! pyfreopen("CONIN$", "r", py__acrt_iob_func(0)); else ! freopen("CONIN$", "r", stdin); } #else # define reset_stdin() --- 938,948 ---- pyfreopen = (void*)GetProcAddress(hpystdiodll, "freopen"); } ! // Reconnect stdin to NUL. if (pyfreopen) ! pyfreopen("NUL", "r", py__acrt_iob_func(0)); else ! freopen("NUL", "r", stdin); } #else # define reset_stdin() *** ../vim-8.2.1789/src/version.c 2020-10-03 13:41:49.959173003 +0200 --- src/version.c 2020-10-03 13:56:52.741165921 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1790, /**/ -- How To Keep A Healthy Level Of Insanity: 18. When leaving the zoo, start running towards the parking lot, yelling "run for your lives, they're loose!!" /// 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 ///