Karsten Hopp 4367ea
To: vim_dev@googlegroups.com
Karsten Hopp 4367ea
Subject: Patch 7.3.711
Karsten Hopp 4367ea
Fcc: outbox
Karsten Hopp 4367ea
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4367ea
Mime-Version: 1.0
Karsten Hopp 4367ea
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4367ea
Content-Transfer-Encoding: 8bit
Karsten Hopp 4367ea
------------
Karsten Hopp 4367ea
Karsten Hopp 4367ea
Patch 7.3.711 (after 7.3.688)
Karsten Hopp 4367ea
Problem:    vim.current.buffer is not available. (lilydjwg)
Karsten Hopp 4367ea
Solution:   Use py3_PyUnicode_AsUTF8 instead of py3_PyUnicode_AsUTF8String.
Karsten Hopp 4367ea
            (Ken Takata)
Karsten Hopp 4367ea
Files:      src/if_python3.c
Karsten Hopp 4367ea
Karsten Hopp 4367ea
Karsten Hopp 4367ea
*** ../vim-7.3.710/src/if_python3.c	2012-10-21 01:46:56.000000000 +0200
Karsten Hopp 4367ea
--- src/if_python3.c	2012-10-23 05:15:31.000000000 +0200
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 176,182 ****
Karsten Hopp 4367ea
  # define PyImport_AppendInittab py3_PyImport_AppendInittab
Karsten Hopp 4367ea
  # if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
  #  undef _PyUnicode_AsString
Karsten Hopp 4367ea
! #  define _PyUnicode_AsString py3_PyUnicode_AsUTF8String
Karsten Hopp 4367ea
  # else
Karsten Hopp 4367ea
  #  define _PyUnicode_AsString py3__PyUnicode_AsString
Karsten Hopp 4367ea
  # endif
Karsten Hopp 4367ea
--- 176,182 ----
Karsten Hopp 4367ea
  # define PyImport_AppendInittab py3_PyImport_AppendInittab
Karsten Hopp 4367ea
  # if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
  #  undef _PyUnicode_AsString
Karsten Hopp 4367ea
! #  define _PyUnicode_AsString py3_PyUnicode_AsUTF8
Karsten Hopp 4367ea
  # else
Karsten Hopp 4367ea
  #  define _PyUnicode_AsString py3__PyUnicode_AsString
Karsten Hopp 4367ea
  # endif
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 286,296 ****
Karsten Hopp 4367ea
  static PyObject* py3__Py_TrueStruct;
Karsten Hopp 4367ea
  static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
Karsten Hopp 4367ea
  static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
Karsten Hopp 4367ea
! #if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
! static char* (*py3_PyUnicode_AsUTF8String)(PyObject *unicode);
Karsten Hopp 4367ea
! #else
Karsten Hopp 4367ea
  static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
Karsten Hopp 4367ea
! #endif
Karsten Hopp 4367ea
  static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors);
Karsten Hopp 4367ea
  static char* (*py3_PyBytes_AsString)(PyObject *bytes);
Karsten Hopp 4367ea
  static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length);
Karsten Hopp 4367ea
--- 286,296 ----
Karsten Hopp 4367ea
  static PyObject* py3__Py_TrueStruct;
Karsten Hopp 4367ea
  static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
Karsten Hopp 4367ea
  static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
Karsten Hopp 4367ea
! # if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
! static char* (*py3_PyUnicode_AsUTF8)(PyObject *unicode);
Karsten Hopp 4367ea
! # else
Karsten Hopp 4367ea
  static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
Karsten Hopp 4367ea
! # endif
Karsten Hopp 4367ea
  static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors);
Karsten Hopp 4367ea
  static char* (*py3_PyBytes_AsString)(PyObject *bytes);
Karsten Hopp 4367ea
  static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length);
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 348,360 ****
Karsten Hopp 4367ea
      {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
Karsten Hopp 4367ea
      {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
Karsten Hopp 4367ea
      {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
Karsten Hopp 4367ea
! #ifndef PY_SSIZE_T_CLEAN
Karsten Hopp 4367ea
      {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
Karsten Hopp 4367ea
      {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
Karsten Hopp 4367ea
! #else
Karsten Hopp 4367ea
      {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
Karsten Hopp 4367ea
      {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
Karsten Hopp 4367ea
! #endif
Karsten Hopp 4367ea
      {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
Karsten Hopp 4367ea
      {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
Karsten Hopp 4367ea
      {"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
Karsten Hopp 4367ea
--- 348,360 ----
Karsten Hopp 4367ea
      {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
Karsten Hopp 4367ea
      {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
Karsten Hopp 4367ea
      {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
Karsten Hopp 4367ea
! # ifndef PY_SSIZE_T_CLEAN
Karsten Hopp 4367ea
      {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
Karsten Hopp 4367ea
      {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
Karsten Hopp 4367ea
! # else
Karsten Hopp 4367ea
      {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
Karsten Hopp 4367ea
      {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
Karsten Hopp 4367ea
! # endif
Karsten Hopp 4367ea
      {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
Karsten Hopp 4367ea
      {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
Karsten Hopp 4367ea
      {"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 406,416 ****
Karsten Hopp 4367ea
      {"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
Karsten Hopp 4367ea
      {"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject},
Karsten Hopp 4367ea
      {"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab},
Karsten Hopp 4367ea
! #if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
!     {"PyUnicode_AsUTF8String", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8String},
Karsten Hopp 4367ea
! #else
Karsten Hopp 4367ea
      {"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
Karsten Hopp 4367ea
! #endif
Karsten Hopp 4367ea
      {"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
Karsten Hopp 4367ea
      {"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
Karsten Hopp 4367ea
      {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
Karsten Hopp 4367ea
--- 406,416 ----
Karsten Hopp 4367ea
      {"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
Karsten Hopp 4367ea
      {"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject},
Karsten Hopp 4367ea
      {"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab},
Karsten Hopp 4367ea
! # if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
!     {"PyUnicode_AsUTF8", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8},
Karsten Hopp 4367ea
! # else
Karsten Hopp 4367ea
      {"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
Karsten Hopp 4367ea
! # endif
Karsten Hopp 4367ea
      {"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
Karsten Hopp 4367ea
      {"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
Karsten Hopp 4367ea
      {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 503,514 ****
Karsten Hopp 4367ea
  
Karsten Hopp 4367ea
      /* Load unicode functions separately as only the ucs2 or the ucs4 functions
Karsten Hopp 4367ea
       * will be present in the library. */
Karsten Hopp 4367ea
! #if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
      ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
Karsten Hopp 4367ea
      ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
Karsten Hopp 4367ea
      ucs_as_encoded_string = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  	    "PyUnicode_AsEncodedString");
Karsten Hopp 4367ea
! #else
Karsten Hopp 4367ea
      ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
Karsten Hopp 4367ea
      ucs_decode = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  	    "PyUnicodeUCS2_Decode");
Karsten Hopp 4367ea
--- 503,514 ----
Karsten Hopp 4367ea
  
Karsten Hopp 4367ea
      /* Load unicode functions separately as only the ucs2 or the ucs4 functions
Karsten Hopp 4367ea
       * will be present in the library. */
Karsten Hopp 4367ea
! # if PY_VERSION_HEX >= 0x030300f0
Karsten Hopp 4367ea
      ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
Karsten Hopp 4367ea
      ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
Karsten Hopp 4367ea
      ucs_as_encoded_string = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  	    "PyUnicode_AsEncodedString");
Karsten Hopp 4367ea
! # else
Karsten Hopp 4367ea
      ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
Karsten Hopp 4367ea
      ucs_decode = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  	    "PyUnicodeUCS2_Decode");
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 523,529 ****
Karsten Hopp 4367ea
  	ucs_as_encoded_string = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  		"PyUnicodeUCS4_AsEncodedString");
Karsten Hopp 4367ea
      }
Karsten Hopp 4367ea
! #endif
Karsten Hopp 4367ea
      if (ucs_from_string && ucs_decode && ucs_as_encoded_string)
Karsten Hopp 4367ea
      {
Karsten Hopp 4367ea
  	py3_PyUnicode_FromString = ucs_from_string;
Karsten Hopp 4367ea
--- 523,529 ----
Karsten Hopp 4367ea
  	ucs_as_encoded_string = symbol_from_dll(hinstPy3,
Karsten Hopp 4367ea
  		"PyUnicodeUCS4_AsEncodedString");
Karsten Hopp 4367ea
      }
Karsten Hopp 4367ea
! # endif
Karsten Hopp 4367ea
      if (ucs_from_string && ucs_decode && ucs_as_encoded_string)
Karsten Hopp 4367ea
      {
Karsten Hopp 4367ea
  	py3_PyUnicode_FromString = ucs_from_string;
Karsten Hopp 4367ea
*** ../vim-7.3.710/src/version.c	2012-10-23 05:08:49.000000000 +0200
Karsten Hopp 4367ea
--- src/version.c	2012-10-23 05:14:27.000000000 +0200
Karsten Hopp 4367ea
***************
Karsten Hopp 4367ea
*** 727,728 ****
Karsten Hopp 4367ea
--- 727,730 ----
Karsten Hopp 4367ea
  {   /* Add new patch number below this line */
Karsten Hopp 4367ea
+ /**/
Karsten Hopp 4367ea
+     711,
Karsten Hopp 4367ea
  /**/
Karsten Hopp 4367ea
Karsten Hopp 4367ea
-- 
Karsten Hopp 4367ea
The fastest way to get an engineer to solve a problem is to declare that the
Karsten Hopp 4367ea
problem is unsolvable.  No engineer can walk away from an unsolvable problem
Karsten Hopp 4367ea
until it's solved.
Karsten Hopp 4367ea
				(Scott Adams - The Dilbert principle)
Karsten Hopp 4367ea
Karsten Hopp 4367ea
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4367ea
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4367ea
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4367ea
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///