To: vim_dev@googlegroups.com Subject: Patch 7.4.1864 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1864 Problem: Python: encoding error with Python 2. Solution: Use "getcwdu" instead of "getcwd". (Ken Takata) Files: src/if_py_both.h *** ../vim-7.4.1863/src/if_py_both.h 2016-05-25 20:38:49.753864614 +0200 --- src/if_py_both.h 2016-06-01 20:36:22.625547131 +0200 *************** *** 6770,6777 **** --- 6770,6782 ---- return -1; ADD_OBJECT(m, "os", other_module); + #if PY_MAJOR_VERSION >= 3 if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwd"))) return -1; + #else + if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwdu"))) + return -1; + #endif ADD_OBJECT(m, "_getcwd", py_getcwd) if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) *** ../vim-7.4.1863/src/version.c 2016-06-01 20:31:40.281551014 +0200 --- src/version.c 2016-06-01 20:37:32.537546169 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1864, /**/ -- The only backup you need is the one that you didn't have time for. (Murphy) /// 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 ///