comparison src/if_py_both.h @ 3056:2665b456ee59 v7.3.300

updated for version 7.3.300 Problem: Python doesn't parse multi-byte argument correctly. Solution: Use "t" instead of "s". (lilydjwg)
author Bram Moolenaar <bram@vim.org>
date Wed, 07 Sep 2011 19:30:21 +0200
parents 0bef86c5c985
children 60f6df978a41
comparison
equal deleted inserted replaced
3055:669634ac295c 3056:2665b456ee59
72 { 72 {
73 int len; 73 int len;
74 char *str = NULL; 74 char *str = NULL;
75 int error = ((OutputObject *)(self))->error; 75 int error = ((OutputObject *)(self))->error;
76 76
77 if (!PyArg_ParseTuple(args, "es#", ENC_OPT, &str, &len)) 77 if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
78 return NULL; 78 return NULL;
79 79
80 Py_BEGIN_ALLOW_THREADS 80 Py_BEGIN_ALLOW_THREADS
81 Python_Lock_Vim(); 81 Python_Lock_Vim();
82 writer((writefn)(error ? emsg : msg), (char_u *)str, len); 82 writer((writefn)(error ? emsg : msg), (char_u *)str, len);
112 { 112 {
113 PyObject *line = PyList_GetItem(list, i); 113 PyObject *line = PyList_GetItem(list, i);
114 char *str = NULL; 114 char *str = NULL;
115 PyInt len; 115 PyInt len;
116 116
117 if (!PyArg_Parse(line, "es#", ENC_OPT, &str, &len)) { 117 if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) {
118 PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); 118 PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
119 Py_DECREF(list); 119 Py_DECREF(list);
120 return NULL; 120 return NULL;
121 } 121 }
122 122