Loading ...
Sorry, an error occurred while loading the content.

Re: [PATCH] (7/7) Consistency and refactoring

Expand Messages
  • ZyX
    # HG changeset patch # User ZyX # Date 1371395827 -14400 # Sun Jun 16 19:17:07 2013 +0400 # Branch python-fixes # Node ID
    Message 1 of 25 , Jun 16, 2013
    • 0 Attachment
      # HG changeset patch
      # User ZyX <kp-pav@...>
      # Date 1371395827 -14400
      # Sun Jun 16 19:17:07 2013 +0400
      # Branch python-fixes
      # Node ID e4cfe82588f5203b9dfd71e1d8668f2f1900f72a
      # Parent 55671c8e22056cd070287fc271e1f0aba731ec58
      Some variable renamings and more tabs in variable declarations

      diff -r 55671c8e2205 -r e4cfe82588f5 src/eval.c
      --- a/src/eval.c Sun Jun 16 13:16:14 2013 +0400
      +++ b/src/eval.c Sun Jun 16 19:17:07 2013 +0400
      @@ -3226,7 +3226,7 @@
      void *fi_void;
      char_u *arg;
      {
      - forinfo_T *fi = (forinfo_T *)fi_void;
      + forinfo_T *fi = (forinfo_T *)fi_void;
      int result;
      listitem_T *item;

      diff -r 55671c8e2205 -r e4cfe82588f5 src/if_py_both.h
      --- a/src/if_py_both.h Sun Jun 16 13:16:14 2013 +0400
      +++ b/src/if_py_both.h Sun Jun 16 19:17:07 2013 +0400
      @@ -107,28 +107,28 @@
      * Use Py_XDECREF to decrement reference count.
      */
      static char_u *
      -StringToChars(PyObject *object, PyObject **todecref)
      -{
      - char_u *p;
      -
      - if (PyBytes_Check(object))
      - {
      -
      - if (PyBytes_AsStringAndSize(object, (char **) &p, NULL) == -1
      - || p == NULL)
      +StringToChars(PyObject *obj, PyObject **todecref)
      +{
      + char_u *str;
      +
      + if (PyBytes_Check(obj))
      + {
      +
      + if (PyBytes_AsStringAndSize(obj, (char **) &str, NULL) == -1
      + || str == NULL)
      return NULL;

      *todecref = NULL;
      }
      - else if (PyUnicode_Check(object))
      + else if (PyUnicode_Check(obj))
      {
      PyObject *bytes;

      - if (!(bytes = PyUnicode_AsEncodedString(object, ENC_OPT, NULL)))
      + if (!(bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL)))
      return NULL;

      - if(PyBytes_AsStringAndSize(bytes, (char **) &p, NULL) == -1
      - || p == NULL)
      + if(PyBytes_AsStringAndSize(bytes, (char **) &str, NULL) == -1
      + || str == NULL)
      {
      Py_DECREF(bytes);
      return NULL;
      @@ -144,11 +144,11 @@
      #else
      "expected bytes() or str() instance, but got %s"
      #endif
      - , Py_TYPE_NAME(object));
      + , Py_TYPE_NAME(obj));
      return NULL;
      }

      - return (char_u *) p;
      + return (char_u *) str;
      }

      #define NUMBER_LONG 1
      @@ -263,35 +263,35 @@
      {
      PyMethodDef *method;
      char **attr;
      - PyObject *r;
      -
      - if (!(r = PyList_New(0)))
      + PyObject *ret;
      +
      + if (!(ret = PyList_New(0)))
      return NULL;

      if (self)
      for (method = self->ob_type->tp_methods ; method->ml_name != NULL ; ++method)
      - if (add_string(r, (char *) method->ml_name))
      + if (add_string(ret, (char *) method->ml_name))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      for (attr = attributes ; *attr ; ++attr)
      - if (add_string(r, *attr))
      + if (add_string(ret, *attr))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      #if PY_MAJOR_VERSION < 3
      - if (add_string(r, "__members__"))
      - {
      - Py_DECREF(r);
      + if (add_string(ret, "__members__"))
      + {
      + Py_DECREF(ret);
      return NULL;
      }
      #endif

      - return r;
      + return ret;
      }

      /* Output buffer management
      @@ -321,9 +321,9 @@
      }

      static int
      -OutputSetattr(OutputObject *self, char *name, PyObject *val)
      -{
      - if (val == NULL)
      +OutputSetattr(OutputObject *self, char *name, PyObject *valObject)
      +{
      + if (valObject == NULL)
      {
      PyErr_SET_STRING(PyExc_AttributeError,
      "can't delete OutputObject attributes");
      @@ -332,7 +332,7 @@

      if (strcmp(name, "softspace") == 0)
      {
      - if (NumberToLong(val, &(self->softspace), NUMBER_UNSIGNED))
      + if (NumberToLong(valObject, &(self->softspace), NUMBER_UNSIGNED))
      return -1;
      return 0;
      }
      @@ -519,10 +519,10 @@
      static PyObject *
      LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED)
      {
      - PyObject *r = self->module;
      -
      - Py_INCREF(r);
      - return r;
      + PyObject *ret = self->module;
      +
      + Py_INCREF(ret);
      + return ret;
      }

      static struct PyMethodDef LoaderMethods[] = {
      @@ -580,7 +580,7 @@
      VimCommand(PyObject *self UNUSED, PyObject *string)
      {
      char_u *cmd;
      - PyObject *result;
      + PyObject *ret;
      PyObject *todecref;

      if (!(cmd = StringToChars(string, &todecref)))
      @@ -597,13 +597,13 @@
      Py_END_ALLOW_THREADS

      if (VimTryEnd())
      - result = NULL;
      + ret = NULL;
      else
      - result = Py_None;
      -
      - Py_XINCREF(result);
      + ret = Py_None;
      +
      + Py_XINCREF(ret);
      Py_XDECREF(todecref);
      - return result;
      + return ret;
      }

      /*
      @@ -616,7 +616,7 @@
      static PyObject *
      VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
      {
      - PyObject *result;
      + PyObject *ret;
      PyObject *newObj;
      char ptrBuf[sizeof(void *) * 2 + 3];

      @@ -624,8 +624,8 @@
      if (depth > 100)
      {
      Py_INCREF(Py_None);
      - result = Py_None;
      - return result;
      + ret = Py_None;
      + return ret;
      }

      /* Check if we run into a recursive loop. The item must be in lookup_dict
      @@ -637,15 +637,15 @@
      our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list
      : (void *)our_tv->vval.v_dict);

      - if ((result = PyDict_GetItemString(lookup_dict, ptrBuf)))
      + if ((ret = PyDict_GetItemString(lookup_dict, ptrBuf)))
      {
      - Py_INCREF(result);
      - return result;
      + Py_INCREF(ret);
      + return ret;
      }
      }

      if (our_tv->v_type == VAR_STRING)
      - result = PyString_FromString(our_tv->vval.v_string == NULL
      + ret = PyString_FromString(our_tv->vval.v_string == NULL
      ? "" : (char *)our_tv->vval.v_string);
      else if (our_tv->v_type == VAR_NUMBER)
      {
      @@ -653,7 +653,7 @@

      /* For backwards compatibility numbers are stored as strings. */
      sprintf(buf, "%ld", (long)our_tv->vval.v_number);
      - result = PyString_FromString((char *) buf);
      + ret = PyString_FromString((char *) buf);
      }
      # ifdef FEAT_FLOAT
      else if (our_tv->v_type == VAR_FLOAT)
      @@ -661,7 +661,7 @@
      char buf[NUMBUFLEN];

      sprintf(buf, "%f", our_tv->vval.v_float);
      - result = PyString_FromString((char *) buf);
      + ret = PyString_FromString((char *) buf);
      }
      # endif
      else if (our_tv->v_type == VAR_LIST)
      @@ -672,12 +672,12 @@
      if (list == NULL)
      return NULL;

      - if (!(result = PyList_New(0)))
      + if (!(ret = PyList_New(0)))
      return NULL;

      - if (PyDict_SetItemString(lookup_dict, ptrBuf, result))
      + if (PyDict_SetItemString(lookup_dict, ptrBuf, ret))
      {
      - Py_DECREF(result);
      + Py_DECREF(ret);
      return NULL;
      }

      @@ -685,13 +685,13 @@
      {
      if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookup_dict)))
      {
      - Py_DECREF(result);
      + Py_DECREF(ret);
      return NULL;
      }
      - if (PyList_Append(result, newObj))
      + if (PyList_Append(ret, newObj))
      {
      Py_DECREF(newObj);
      - Py_DECREF(result);
      + Py_DECREF(ret);
      return NULL;
      }
      Py_DECREF(newObj);
      @@ -707,12 +707,12 @@
      if (our_tv->vval.v_dict == NULL)
      return NULL;

      - if (!(result = PyDict_New()))
      + if (!(ret = PyDict_New()))
      return NULL;

      - if (PyDict_SetItemString(lookup_dict, ptrBuf, result))
      + if (PyDict_SetItemString(lookup_dict, ptrBuf, ret))
      {
      - Py_DECREF(result);
      + Py_DECREF(ret);
      return NULL;
      }

      @@ -725,12 +725,12 @@
      di = dict_lookup(hi);
      if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookup_dict)))
      {
      - Py_DECREF(result);
      + Py_DECREF(ret);
      return NULL;
      }
      - if (PyDict_SetItemString(result, (char *)hi->hi_key, newObj))
      + if (PyDict_SetItemString(ret, (char *)hi->hi_key, newObj))
      {
      - Py_DECREF(result);
      + Py_DECREF(ret);
      Py_DECREF(newObj);
      return NULL;
      }
      @@ -740,10 +740,10 @@
      else
      {
      Py_INCREF(Py_None);
      - result = Py_None;
      - }
      -
      - return result;
      + ret = Py_None;
      + }
      +
      + return ret;
      }

      static PyObject *
      @@ -753,7 +753,7 @@
      typval_T *our_tv;
      PyObject *string;
      PyObject *todecref;
      - PyObject *result;
      + PyObject *ret;
      PyObject *lookup_dict;

      if (!PyArg_ParseTuple(args, "O", &string))
      @@ -783,10 +783,10 @@
      /* Convert the Vim type into a Python type. Create a dictionary that's
      * used to check for recursive loops. */
      if (!(lookup_dict = PyDict_New()))
      - result = NULL;
      + ret = NULL;
      else
      {
      - result = VimToPython(our_tv, 1, lookup_dict);
      + ret = VimToPython(our_tv, 1, lookup_dict);
      Py_DECREF(lookup_dict);
      }

      @@ -797,7 +797,7 @@
      Python_Release_Vim();
      Py_END_ALLOW_THREADS

      - return result;
      + return ret;
      }

      static PyObject *ConvertToPyObject(typval_T *);
      @@ -806,7 +806,7 @@
      VimEvalPy(PyObject *self UNUSED, PyObject *string)
      {
      typval_T *our_tv;
      - PyObject *result;
      + PyObject *ret;
      char_u *expr;
      PyObject *todecref;

      @@ -831,14 +831,14 @@
      return NULL;
      }

      - result = ConvertToPyObject(our_tv);
      + ret = ConvertToPyObject(our_tv);
      Py_BEGIN_ALLOW_THREADS
      Python_Lock_Vim();
      free_tv(our_tv);
      Python_Release_Vim();
      Py_END_ALLOW_THREADS

      - return result;
      + return ret;
      }

      static PyObject *
      @@ -846,44 +846,44 @@
      {
      char_u *str;
      PyObject *todecref;
      - int result;
      + int len;

      if (!(str = StringToChars(string, &todecref)))
      return NULL;

      #ifdef FEAT_MBYTE
      - result = mb_string2cells(str, (int)STRLEN(str));
      + len = mb_string2cells(str, (int)STRLEN(str));
      #else
      - result = STRLEN(str);
      + len = STRLEN(str);
      #endif

      Py_XDECREF(todecref);

      - return PyLong_FromLong(result);
      + return PyLong_FromLong(len);
      }

      static PyObject *
      _VimChdir(PyObject *_chdir, PyObject *args, PyObject *kwargs)
      {
      - PyObject *r;
      + PyObject *ret;
      PyObject *newwd;
      PyObject *todecref;
      char_u *new_dir;

      if (_chdir == NULL)
      return NULL;
      - if (!(r = PyObject_Call(_chdir, args, kwargs)))
      + if (!(ret = PyObject_Call(_chdir, args, kwargs)))
      return NULL;

      if (!(newwd = PyObject_CallFunctionObjArgs(py_getcwd, NULL)))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      if (!(new_dir = StringToChars(newwd, &todecref)))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      Py_DECREF(newwd);
      return NULL;
      }
      @@ -892,7 +892,7 @@

      if (vim_chdir(new_dir))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      Py_DECREF(newwd);
      Py_XDECREF(todecref);

      @@ -910,11 +910,11 @@

      if (VimTryEnd())
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1053,20 +1053,20 @@
      static PyObject *
      Vim_GetPaths(PyObject *self UNUSED)
      {
      - PyObject *r;
      -
      - if (!(r = PyList_New(0)))
      + PyObject *ret;
      +
      + if (!(ret = PyList_New(0)))
      return NULL;

      - do_in_runtimepath(NULL, FALSE, &map_finder_callback, r);
      + do_in_runtimepath(NULL, FALSE, &map_finder_callback, ret);

      if (PyErr_Occurred())
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1401,16 +1401,16 @@
      static dict_T *
      py_dict_alloc(void)
      {
      - dict_T *r;
      -
      - if (!(r = dict_alloc()))
      + dict_T *ret;
      +
      + if (!(ret = dict_alloc()))
      {
      PyErr_NoMemory();
      return NULL;
      }
      - ++r->dv_refcount;
      -
      - return r;
      + ++ret->dv_refcount;
      +
      + return ret;
      }

      static PyObject *
      @@ -1462,9 +1462,9 @@
      }

      static int
      -DictionarySetattr(DictionaryObject *self, char *name, PyObject *val)
      -{
      - if (val == NULL)
      +DictionarySetattr(DictionaryObject *self, char *name, PyObject *valObject)
      +{
      + if (valObject == NULL)
      {
      PyErr_SET_STRING(PyExc_AttributeError,
      "cannot delete vim.Dictionary attributes");
      @@ -1480,7 +1480,7 @@
      }
      else
      {
      - int istrue = PyObject_IsTrue(val);
      + int istrue = PyObject_IsTrue(valObject);
      if (istrue == -1)
      return -1;
      else if (istrue)
      @@ -1514,7 +1514,7 @@
      {
      PyObject *keyObject;
      PyObject *defObject = ((flags & DICT_FLAG_NONE_DEFAULT)? Py_None : NULL);
      - PyObject *r;
      + PyObject *ret;
      char_u *key;
      dictitem_T *di;
      dict_T *dict = self->dict;
      @@ -1567,7 +1567,7 @@

      di = dict_lookup(hi);

      - if (!(r = ConvertToPyObject(&di->di_tv)))
      + if (!(ret = ConvertToPyObject(&di->di_tv)))
      return NULL;

      if (flags & DICT_FLAG_POP)
      @@ -1575,7 +1575,7 @@
      if (dict->dv_lock)
      {
      RAISE_LOCKED_DICTIONARY;
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }

      @@ -1583,7 +1583,7 @@
      dictitem_free(di);
      }

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1596,13 +1596,13 @@
      DictionaryContains(DictionaryObject *self, PyObject *keyObject)
      {
      PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL);
      - int r;
      -
      - r = (rObj == Py_True);
      + int ret;
      +
      + ret = (rObj == Py_True);

      Py_DECREF(Py_True);

      - return r;
      + return ret;
      }

      typedef struct
      @@ -1617,7 +1617,7 @@
      static PyObject *
      DictionaryIterNext(dictiterinfo_T **dii)
      {
      - PyObject *r;
      + PyObject *ret;

      if (!(*dii)->todo)
      return NULL;
      @@ -1635,10 +1635,10 @@

      --((*dii)->todo);

      - if (!(r = PyBytes_FromString((char *) (*dii)->hi->hi_key)))
      + if (!(ret = PyBytes_FromString((char *) (*dii)->hi->hi_key)))
      return NULL;

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1754,26 +1754,26 @@
      dict_T *dict = self->dict;
      long_u todo = dict->dv_hashtab.ht_used;
      Py_ssize_t i = 0;
      - PyObject *r;
      + PyObject *ret;
      hashitem_T *hi;
      PyObject *newObj;

      - r = PyList_New(todo);
      + ret = PyList_New(todo);
      for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi)
      {
      if (!HASHITEM_EMPTY(hi))
      {
      if (!(newObj = hiconvert(hi)))
      {
      - Py_DECREF(r);
      + Py_DECREF(ret);
      return NULL;
      }
      - PyList_SET_ITEM(r, i, newObj);
      + PyList_SET_ITEM(ret, i, newObj);
      --todo;
      ++i;
      }
      }
      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1808,7 +1808,7 @@
      {
      PyObject *keyObject;
      PyObject *valObject;
      - PyObject *r;
      + PyObject *ret;

      if (!(keyObject = dict_key(hi)))
      return NULL;
      @@ -1819,12 +1819,12 @@
      return NULL;
      }

      - r = Py_BuildValue("(OO)", keyObject, valObject);
      + ret = Py_BuildValue("(OO)", keyObject, valObject);

      Py_DECREF(keyObject);
      Py_DECREF(valObject);

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -1859,19 +1859,19 @@
      }
      else
      {
      - PyObject *object;
      -
      - if (!PyArg_ParseTuple(args, "O", &object))
      + PyObject *obj;
      +
      + if (!PyArg_ParseTuple(args, "O", &obj))
      return NULL;

      - if (PyObject_HasAttrString(object, "keys"))
      - return DictionaryUpdate(self, NULL, object);
      + if (PyObject_HasAttrString(obj, "keys"))
      + return DictionaryUpdate(self, NULL, obj);
      else
      {
      PyObject *iterator;
      PyObject *item;

      - if (!(iterator = PyObject_GetIter(object)))
      + if (!(iterator = PyObject_GetIter(obj)))
      return NULL;

      while ((item = PyIter_Next(iterator)))
      @@ -1975,7 +1975,7 @@
      DictionaryPopItem(DictionaryObject *self)
      {
      hashitem_T *hi;
      - PyObject *r;
      + PyObject *ret;
      PyObject *valObject;
      dictitem_T *di;

      @@ -1994,7 +1994,7 @@
      if (!(valObject = ConvertToPyObject(&di->di_tv)))
      return NULL;

      - if (!(r = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, valObject)))
      + if (!(ret = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, valObject)))
      {
      Py_DECREF(valObject);
      return NULL;
      @@ -2003,7 +2003,7 @@
      hash_remove(&self->dict->dv_hashtab, hi);
      dictitem_free(di);

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -2076,16 +2076,16 @@
      static list_T *
      py_list_alloc()
      {
      - list_T *r;
      -
      - if (!(r = list_alloc()))
      + list_T *ret;
      +
      + if (!(ret = list_alloc()))
      {
      PyErr_NoMemory();
      return NULL;
      }
      - ++r->lv_refcount;
      -
      - return r;
      + ++ret->lv_refcount;
      +
      + return ret;
      }

      static int
      @@ -2273,17 +2273,17 @@
      static PyObject *
      ListIterNext(listiterinfo_T **lii)
      {
      - PyObject *r;
      + PyObject *ret;

      if (!((*lii)->lw.lw_item))
      return NULL;

      - if (!(r = ConvertToPyObject(&((*lii)->lw.lw_item->li_tv))))
      + if (!(ret = ConvertToPyObject(&((*lii)->lw.lw_item->li_tv))))
      return NULL;

      (*lii)->lw.lw_item = (*lii)->lw.lw_item->li_next;

      - return r;
      + return ret;
      }

      static PyObject *
      @@ -2320,7 +2320,7 @@
      RAISE_LOCKED_LIST;
      return -1;
      }
      - if (index>length || (index==length && obj==NULL))
      + if (index > length || (index == length && obj == NULL))
      {
      PyErr_SET_STRING(PyExc_IndexError, "list index out of range");
      return -1;
      @@ -2464,9 +2464,9 @@
      }

      static int
      -ListSetattr(ListObject *self, char *name, PyObject *val)
      -{
      - if (val == NULL)
      +ListSetattr(ListObject *self, char *name, PyObject *valObject)
      +{
      + if (valObject == NULL)
      {
      PyErr_SET_STRING(PyExc_AttributeError,
      "cannot delete vim.List attributes");
      @@ -2482,7 +2482,7 @@
      }
      else
      {
      - int istrue = PyObject_IsTrue(val);
      + int istrue = PyObject_IsTrue(valObject);
      if (istrue == -1)
      return -1;
      else if (istrue)
      @@ -2600,7 +2600,7 @@
      typval_T rettv;
      dict_T *selfdict = NULL;
      PyObject *selfdictObject;
      - PyObject *result;
      + PyObject *ret;
      int error;

      if (ConvertFromPyObject(argsObject, &args) == -1)
      @@ -2630,21 +2630,21 @@
      Py_END_ALLOW_THREADS

      if (VimTryEnd())
      - result = NULL;
      + ret = NULL;
      else if (error != OK)
      {
      - result = NULL;
      + ret = NULL;
      PyErr_VIM_FORMAT("failed to run function %s", (char *)name);
      }
      else
      - result = ConvertToPyObject(&rettv);
      + ret = ConvertToPyObject(&rettv);

      clear_tv(&args);
      clear_tv(&rettv);
      if (selfdict != NULL)
      clear_tv(&selfdicttv);

      - return result;
      + return ret;
      }

      static PyObject *
      @@ -2762,10 +2762,10 @@
      }
      else if (flags & SOPT_BOOL)
      {
      - PyObject *r;
      - r = numval ? Py_True : Py_False;
      - Py_INCREF(r);
      - return r;
      + PyObject *ret;
      + ret = numval ? Py_True : Py_False;
      + Py_INCREF(ret);
      + return ret;
      }
      else if (flags & SOPT_NUM)
      return PyInt_FromLong(numval);
      @@ -2773,9 +2773,9 @@
      {
      if (stringval)
      {
      - PyObject *r = PyBytes_FromString((char *) stringval);
      + PyObject *ret = PyBytes_FromString((char *) stringval);
      vim_free(stringval);
      - return r;
      + return ret;
      }
      else
      {
      @@ -2818,7 +2818,7 @@
      win_T *save_curwin = NULL;
      tabpage_T *save_curtab = NULL;
      buf_T *save_curbuf = NULL;
      - int r = 0;
      + int set_ret = 0;

      VimTryStart();
      switch (opt_type)
      @@ -2832,24 +2832,20 @@
      PyErr_SET_VIM("problem while switching windows");
      return -1;
      }
      - r = set_option_value_err(key, numval, stringval, opt_flags);
      - restore_win(save_curwin, save_curtab, FALSE);
      - if (r == FAIL)
      - return -1;
      + set_ret = set_option_value_err(key, numval, stringval, opt_flags);
      + restore_win(save_curwin, save_curtab, TRUE);
      break;
      case SREQ_BUF:
      switch_buffer(&save_curbuf, (buf_T *)from);
      - r = set_option_value_err(key, numval, stringval, opt_flags);
      + set_ret = set_option_value_err(key, numval, stringval, opt_flags);
      restore_buffer(save_curbuf);
      - if (r == FAIL)
      - return -1;
      break;
      case SREQ_GLOBAL:
      - r = set_option_value_err(key, numval, stringval, opt_flags);
      - if (r == FAIL)
      - return -1;
      + set_ret = set_option_value_err(key, numval, stringval, opt_flags);
      break;
      }
      + if (set_ret == FAIL)
      + return -1;
      return VimTryEnd();
      }

      @@ -2859,7 +2855,7 @@
      char_u *key;
      int flags;
      int opt_flags;
      - int r = 0;
      + int ret = 0;
      PyObject *todecref;

      if (self->Check(self->from))
      @@ -2917,9 +2913,9 @@
      int istrue = PyObject_IsTrue(valObject);

      if (istrue == -1)
      - r = -1;
      + ret = -1;
      else
      - r = set_option_value_for(key, istrue, NULL,
      + ret = set_option_value_for(key, istrue, NULL,
      opt_flags, self->opt_type, self->from);
      }
      else if (flags & SOPT_NUM)
      @@ -2932,24 +2928,24 @@
      return -1;
      }

      - r = set_option_value_for(key, (int) val, NULL, opt_flags,
      + ret = set_option_value_for(key, (int) val, NULL, opt_flags,
      self->opt_type, self->from);
      }
      else
      {
      - char_u *val;
      + char_u *val;
      PyObject *todecref;

      if ((val = StringToChars(valObject, &todecref)))
      - r = set_option_value_for(key, 0, val, opt_flags,
      + ret = set_option_value_for(key, 0, val, opt_flags,
      self->opt_type, self->from);
      else
      - r = -1;
      + ret = -1;
      }

      Py_XDECREF(todecref);

      - return r;
      + return ret;
      }

      static PyMappingMethods OptionsAsMapping = {
      @@ -3028,14 +3024,14 @@
      static PyObject *
      TabPageAttrValid(TabPageObject *self, char *name)
      {
      - PyObject *r;
      + PyObject *ret;

      if (strcmp(name, "valid") != 0)
      return NULL;

      - r = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True);
      - Py_INCREF(r);
      - return r;
      + ret = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True);
      + Py_INCREF(ret);
      + return ret;
      }

      static PyObject *
      @@ -3243,14 +3239,14 @@
      static PyObject *
      WindowAttrValid(WindowObject *self, char *name)
      {
      - PyObject *r;
      + PyObject *ret;

      if (strcmp(name, "valid") != 0)
      return NULL;

      - r = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True);
      - Py_INCREF(r);
      - return r;
      + ret = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True);
      + Py_INCREF(ret);
      + return ret;
      }

      static PyObject *
      @@ -3300,7 +3296,7 @@
      }

      static int
      -WindowSetattr(WindowObject *self, char *name, PyObject *val)
      +WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
      {
      if (CheckWindow(self))
      return -1;
      @@ -3315,7 +3311,7 @@
      long lnum;
      long col;

      - if (!PyArg_Parse(val, "(ll)", &lnum, &col))
      + if (!PyArg_Parse(valObject, "(ll)", &lnum, &col))
      return -1;

      if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count)
      @@ -3344,7 +3340,7 @@
      long height;
      win_T *savewin;

      - if (NumberToLong(val, &height, NUMBER_INT))
      + if (NumberToLong(valObject, &height, NUMBER_INT))
      return -1;

      #ifdef FEAT_GUI
      @@ -3367,7 +3363,7 @@
      long width;
      win_T *savewin;

      - if (NumberToLong(val, &width, NUMBER_INT))
      + if (NumberToLong(valObject, &width, NUMBER_INT))
      return -1;

      #ifdef FEAT_GUI
      @@ -3584,25 +3580,26 @@
      static PyObject *
      GetBufferLineList(buf_T *buf, PyInt lo, PyInt hi)
      {
      - PyInt i;
      - PyInt n = hi - lo;
      - PyObject *list = PyList_New(n);
      + PyInt i;
      + PyInt n = hi - lo;
      + PyObject *list = PyList_New(n);

      if (list == NULL)
      return NULL;

      for (i = 0; i < n; ++i)
      {
      - PyObject *str = LineToString((char *)ml_get_buf(buf, (linenr_T)(lo+i), FALSE));
      + PyObject *string = LineToString(
      + (char *)ml_get_buf(buf, (linenr_T)(lo+i), FALSE));

      /* Error check - was the Python string creation OK? */
      - if (str == NULL)
      + if (string == NULL)
      {
      Py_DECREF(list);
      return NULL;
      }

      - PyList_SET_ITEM(list, i, str);
      + PyList_SET_ITEM(list, i, string);
      }

      /* The ownership of the Python list is passed to the caller (ie,
      @@ -3662,7 +3659,7 @@
      */
      if (line == Py_None || line == NULL)
      {
      - buf_T *savebuf;
      + buf_T *savebuf;

      PyErr_Clear();
      switch_buffer(&savebuf, buf);
      @@ -3747,7 +3744,12 @@
      * is set to the change in the buffer length.
      */
      static int
      -SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change)
      +SetBufferLineList(
      + buf_T *buf,
      + PyInt lo,
      + PyInt hi,
      + PyObject *list,
      + PyInt *len_change)
      {
      /* First of all, we check the type of the supplied Python object.
      * There are three cases:
      @@ -4124,7 +4126,13 @@
      }

      static PyInt
      -RBAsItem(BufferObject *self, PyInt n, PyObject *val, PyInt start, PyInt end, PyInt *new_end)
      +RBAsItem(
      + BufferObject *self,
      + PyInt n,
      + PyObject *valObject,
      + PyInt start,
      + PyInt end,
      + PyInt *new_end)
      {
      PyInt len_change;

      @@ -4143,7 +4151,7 @@
      return -1;
      }

      - if (SetBufferLine(self->buf, n+start, val, &len_change) == FAIL)
      + if (SetBufferLine(self->buf, n+start, valObject, &len_change) == FAIL)
      return -1;

      if (new_end)
      @@ -4153,7 +4161,14 @@
      }

      static PyInt
      -RBAsSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, PyInt start, PyInt end, PyInt *new_end)
      +RBAsSlice(
      + BufferObject *self,
      + PyInt lo,
      + PyInt hi,
      + PyObject *valObject,
      + PyInt start,
      + PyInt end,
      + PyInt *new_end)
      {
      PyInt size;
      PyInt len_change;
      @@ -4180,7 +4195,7 @@
      hi = size;

      if (SetBufferLineList(self->buf, lo + start, hi + start,
      - val, &len_change) == FAIL)
      + valObject, &len_change) == FAIL)
      return -1;

      if (new_end)
      @@ -4191,7 +4206,12 @@


      static PyObject *
      -RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end)
      +RBAppend(
      + BufferObject *self,
      + PyObject *args,
      + PyInt start,
      + PyInt end,
      + PyInt *new_end)
      {
      PyObject *lines;
      PyInt len_change;
      @@ -4438,14 +4458,14 @@
      static PyObject *
      BufferAttrValid(BufferObject *self, char *name)
      {
      - PyObject *r;
      + PyObject *ret;

      if (strcmp(name, "valid") != 0)
      return NULL;

      - r = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True);
      - Py_INCREF(r);
      - return r;
      + ret = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True);
      + Py_INCREF(ret);
      + return ret;
      }

      static PyObject *
      @@ -4475,9 +4495,9 @@

      if (strcmp(name, "name") == 0)
      {
      - char_u *val;
      + char_u *val;
      aco_save_T aco;
      - int r;
      + int ren_ret;
      PyObject *todecref;

      if (!(val = StringToChars(valObject, &todecref)))
      @@ -4486,13 +4506,13 @@
      VimTryStart();
      /* Using aucmd_*: autocommands will be executed by rename_buffer */
      aucmd_prepbuf(&aco, self->buf);
      - r = rename_buffer(val);
      + ren_ret = rename_buffer(val);
      aucmd_restbuf(&aco);
      Py_XDECREF(todecref);
      if (VimTryEnd())
      return -1;

      - if (r == FAIL)
      + if (ren_ret == FAIL)
      {
      PyErr_SET_VIM("failed to rename buffer");
      return -1;
      @@ -4677,27 +4697,27 @@
      BufMapIterNext(PyObject **buffer)
      {
      PyObject *next;
      - PyObject *r;
      + PyObject *ret;

      if (!*buffer)
      return NULL;

      - r = *buffer;
      -
      - if (CheckBuffer((BufferObject *)(r)))
      + ret = *buffer;
      +
      + if (CheckBuffer((BufferObject *)(ret)))
      {
      *buffer = NULL;
      return NULL;
      }

      - if (!((BufferObject *)(r))->buf->b_next)
      + if (!((BufferObject *)(ret))->buf->b_next)
      next = NULL;
      - else if (!(next = BufferNew(((BufferObject *)(r))->buf->b_next)))
      + else if (!(next = BufferNew(((BufferObject *)(ret))->buf->b_next)))
      return NULL;
      *buffer = next;
      /* Do not increment reference: we no longer hold it (decref), but whoever
      * on other side will hold (incref). Decref+incref = nothing. */
      - return r;
      + return ret;
      }

      static PyObject *
      @@ -4755,11 +4775,12 @@
      }

      static int
      -CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *value)
      +CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *valObject)
      {
      if (strcmp(name, "line") == 0)
      {
      - if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL)
      + if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, valObject,
      + NULL) == FAIL)
      return -1;

      return 0;
      @@ -4768,17 +4789,17 @@
      {
      int count;

      - if (value->ob_type != &BufferType)
      + if (valObject->ob_type != &BufferType)
      {
      PyErr_FORMAT(PyExc_TypeError,
      "expected vim.Buffer object, but got %s",
      - Py_TYPE_NAME(value));
      + Py_TYPE_NAME(valObject));
      return -1;
      }

      - if (CheckBuffer((BufferObject *)(value)))
      + if (CheckBuffer((BufferObject *)(valObject)))
      return -1;
      - count = ((BufferObject *)(value))->buf->b_fnum;
      + count = ((BufferObject *)(valObject))->buf->b_fnum;

      VimTryStart();
      if (do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, count, 0) == FAIL)
      @@ -4795,17 +4816,17 @@
      {
      int count;

      - if (value->ob_type != &WindowType)
      + if (valObject->ob_type != &WindowType)
      {
      PyErr_FORMAT(PyExc_TypeError,
      "expected vim.Window object, but got %s",
      - Py_TYPE_NAME(value));
      + Py_TYPE_NAME(valObject));
      return -1;
      }

      - if (CheckWindow((WindowObject *)(value)))
      + if (CheckWindow((WindowObject *)(valObject)))
      return -1;
      - count = get_win_number(((WindowObject *)(value))->win, firstwin);
      + count = get_win_number(((WindowObject *)(valObject))->win, firstwin);

      if (!count)
      {
      @@ -4815,8 +4836,8 @@
      }

      VimTryStart();
      - win_goto(((WindowObject *)(value))->win);
      - if (((WindowObject *)(value))->win != curwin)
      + win_goto(((WindowObject *)(valObject))->win);
      + if (((WindowObject *)(valObject))->win != curwin)
      {
      if (VimTryEnd())
      return -1;
      @@ -4829,20 +4850,20 @@
      }
      else if (strcmp(name, "tabpage") == 0)
      {
      - if (value->ob_type != &TabPageType)
      + if (valObject->ob_type != &TabPageType)
      {
      PyErr_FORMAT(PyExc_TypeError,
      "expected vim.TabPage object, but got %s",
      - Py_TYPE_NAME(value));
      + Py_TYPE_NAME(valObject));
      return -1;
      }

      - if (CheckTabPage((TabPageObject *)(value)))
      + if (CheckTabPage((TabPageObject *)(valObject)))
      return -1;

      VimTryStart();
      - goto_tabpage_tp(((TabPageObject *)(value))->tab, TRUE, TRUE);
      - if (((TabPageObject *)(value))->tab != curtab)
      + goto_tabpage_tp(((TabPageObject *)(valObject))->tab, TRUE, TRUE);
      + if (((TabPageObject *)(valObject))->tab != curtab)
      {
      if (VimTryEnd())
      return -1;
      @@ -4934,7 +4955,9 @@

      for (lnum = RangeStart; lnum <= RangeEnd; ++lnum)
      {
      - PyObject *line, *linenr, *ret;
      + PyObject *line;
      + PyObject *linenr;
      + PyObject *ret;

      #ifdef PY_CAN_RECURSE
      *pygilstate = PyGILState_Ensure();
      @@ -4990,10 +5013,10 @@
      #endif
      )
      {
      - PyObject *r;
      -
      - r = PyRun_String((char *) cmd, Py_eval_input, globals, globals);
      - if (r == NULL)
      + PyObject *run_ret;
      +
      + run_ret = PyRun_String((char *) cmd, Py_eval_input, globals, globals);
      + if (run_ret == NULL)
      {
      if (PyErr_Occurred() && !msg_silent)
      PyErr_PrintEx(0);
      @@ -5001,9 +5024,9 @@
      }
      else
      {
      - if (ConvertFromPyObject(r, rettv) == -1)
      + if (ConvertFromPyObject(run_ret, rettv) == -1)
      EMSG(_("E859: Failed to convert returned python object to vim value"));
      - Py_DECREF(r);
      + Py_DECREF(run_ret);
      }
      PyErr_Clear();
      }
      @@ -5306,7 +5329,7 @@
      ConvertFromPyMapping(PyObject *obj, typval_T *tv)
      {
      PyObject *lookup_dict;
      - int r;
      + int ret;

      if (!(lookup_dict = PyDict_New()))
      return -1;
      @@ -5316,34 +5339,34 @@
      tv->v_type = VAR_DICT;
      tv->vval.v_dict = (((DictionaryObject *)(obj))->dict);
      ++tv->vval.v_dict->dv_refcount;
      - r = 0;
      + ret = 0;
      }
      else if (PyDict_Check(obj))
      - r = convert_dl(obj, tv, pydict_to_tv, lookup_dict);
      + ret = convert_dl(obj, tv, pydict_to_tv, lookup_dict);
      else if (PyMapping_Check(obj))
      - r = convert_dl(obj, tv, pymap_to_tv, lookup_dict);
      + ret = convert_dl(obj, tv, pymap_to_tv, lookup_dict);
      else
      {
      PyErr_FORMAT(PyExc_TypeError,
      "unable to convert %s to vim dictionary",
      Py_TYPE_NAME(obj));
      - r = -1;
      + ret = -1;
      }
      Py_DECREF(lookup_dict);
      - return r;
      + return ret;
      }

      static int
      ConvertFromPyObject(PyObject *obj, typval_T *tv)
      {
      PyObject *lookup_dict;
      - int r;
      + int ret;

      if (!(lookup_dict = PyDict_New()))
      return -1;
      - r = _ConvertFromPyObject(obj, tv, lookup_dict);
      + ret = _ConvertFromPyObject(obj, tv, lookup_dict);
      Py_DECREF(lookup_dict);
      - return r;
      + return ret;
      }

      static int
      @@ -5371,14 +5394,14 @@
      }
      else if (PyBytes_Check(obj))
      {
      - char_u *result;
      -
      - if (PyBytes_AsStringAndSize(obj, (char **) &result, NULL) == -1)
      + char_u *str;
      +
      + if (PyBytes_AsStringAndSize(obj, (char **) &str, NULL) == -1)
      return -1;
      - if (result == NULL)
      + if (str == NULL)
      return -1;

      - if (set_string_copy(result, tv) == -1)
      + if (set_string_copy(str, tv) == -1)
      return -1;

      tv->v_type = VAR_STRING;
      @@ -5386,18 +5409,18 @@
      else if (PyUnicode_Check(obj))
      {
      PyObject *bytes;
      - char_u *result;
      + char_u *str;

      bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL);
      if (bytes == NULL)
      return -1;

      - if(PyBytes_AsStringAndSize(bytes, (char **) &result, NULL) == -1)
      + if(PyBytes_AsStringAndSize(bytes, (char **) &str, NULL) == -1)
      return -1;
      - if (result == NULL)
      + if (str == NULL)
      return -1;

      - if (set_string_copy(result, tv))
      + if (set_string_copy(str, tv))
      {
      Py_XDECREF(bytes);
      return -1;
      @@ -5852,7 +5875,7 @@

      static struct numeric_constant {
      char *name;
      - int value;
      + int val;
      } numeric_constants[] = {
      {"VAR_LOCKED", VAR_LOCKED},
      {"VAR_FIXED", VAR_FIXED},
      @@ -5862,7 +5885,7 @@

      static struct object_constant {
      char *name;
      - PyObject *value;
      + PyObject *valObject;
      } object_constants[] = {
      {"buffers", (PyObject *)(void *)&TheBufferMap},
      {"windows", (PyObject *)(void *)&TheWindowList},
      @@ -5889,10 +5912,10 @@

      #define ADD_CHECKED_OBJECT(m, name, obj) \
      { \
      - PyObject *value = obj; \
      - if (!value) \
      + PyObject *valObject = obj; \
      + if (!valObject) \
      return -1; \
      - ADD_OBJECT(m, name, value); \
      + ADD_OBJECT(m, name, valObject); \
      }

      static int
      @@ -5907,17 +5930,17 @@
      / sizeof(struct numeric_constant));
      ++i)
      ADD_CHECKED_OBJECT(m, numeric_constants[i].name,
      - PyInt_FromLong(numeric_constants[i].value));
      + PyInt_FromLong(numeric_constants[i].val));

      for (i = 0; i < (int)(sizeof(object_constants)
      / sizeof(struct object_constant));
      ++i)
      {
      - PyObject *value;
      -
      - value = object_constants[i].value;
      - Py_INCREF(value);
      - ADD_OBJECT(m, object_constants[i].name, value);
      + PyObject *valObject;
      +
      + valObject = object_constants[i].valObject;
      + Py_INCREF(valObject);
      + ADD_OBJECT(m, object_constants[i].name, valObject);
      }

      if (!(VimError = PyErr_NewException("vim.error", NULL, NULL)))

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • ZyX
      # HG changeset patch # User ZyX # Date 1371407889 -14400 # Sun Jun 16 22:38:09 2013 +0400 # Branch python-fixes # Node ID
      Message 2 of 25 , Jun 16, 2013
      • 0 Attachment
        # HG changeset patch
        # User ZyX <kp-pav@...>
        # Date 1371407889 -14400
        # Sun Jun 16 22:38:09 2013 +0400
        # Branch python-fixes
        # Node ID 4a00cd941a883917f6d740f9f06aca7baadcb45e
        # Parent e4cfe82588f5203b9dfd71e1d8668f2f1900f72a
        Some fixes:

        - Fixed VimTryEnd: it used to stop processing of the subsequent lines if E***
        error messages were thrown
        - Fixed crash with debug build and PYTHONDUMPREFS=1: for some reason self->name
        in function may be NULL
        - Fixed two memory leaks in StringToLine (in case string contains newlines and
        in case there is no memory left)
        - Fixed memory leak in BufferMark (in case argument is not a single character)
        - Fixed memory leak in convert_dl (always when complex structure encountered)

        - Made tests run 10 times in case PYTHONDUMPREFS=1 is set (I have not checked
        though whether tests succeed in this case: always launched them without make)
        - Made tests delete variables just after they are no longer used
        - Made tests use abc{C} in place of just abc: helps to determine exactly which
        abc did leak

        - Made ConvertFromPyObject also treat subclasses of vim.Function and vim.List
        type as the types themselves like it already does with vim.Dictionary

        diff -r e4cfe82588f5 -r 4a00cd941a88 src/if_py_both.h
        --- a/src/if_py_both.h Sun Jun 16 19:17:07 2013 +0400
        +++ b/src/if_py_both.h Sun Jun 16 22:38:09 2013 +0400
        @@ -545,20 +545,30 @@
        VimTryEnd(void)
        {
        --trylevel;
        + /* Without this it stops processing all subsequent VimL commands and
        + * generates strange error messages if I e.g. try calling Test() in a cycle */
        + did_emsg = FALSE;
        + /* Keyboard interrupt should be preferred over anything else */
        if (got_int)
        {
        + did_throw = got_int = FALSE;
        PyErr_SetNone(PyExc_KeyboardInterrupt);
        - return 1;
        + return -1;
        }
        else if (!did_throw)
        - return 0;
        + return (PyErr_Occurred() ? -1 : 0);
        + /* Python exception is preferred over vim one; unlikely to occur though */
        else if (PyErr_Occurred())
        - return 1;
        + {
        + did_throw = FALSE;
        + return -1;
        + }
        + /* Finally transform VimL exception to python one */
        else
        {
        PyErr_SetVim((char *) current_exception->value);
        discard_current_exception();
        - return 1;
        + return -1;
        }
        }

        @@ -2650,7 +2660,14 @@
        static PyObject *
        FunctionRepr(FunctionObject *self)
        {
        - return PyString_FromFormat("<vim.Function '%s'>", self->name);
        +#ifdef Py_TRACE_REFS
        + /* For unknown reason self->name may be NULL after calling
        + * Finalize */
        + return PyString_FromFormat("<vim.Function '%s'>",
        + (self->name == NULL ? "<NULL>" : (char *) self->name));
        +#else
        + return PyString_FromFormat("<vim.Function '%s'>", (char *) self->name);
        +#endif
        }

        static struct PyMethodDef FunctionMethods[] = {
        @@ -3534,6 +3551,7 @@
        else
        {
        PyErr_SET_VIM("string cannot contain newlines");
        + Py_XDECREF(bytes);
        return NULL;
        }
        }
        @@ -3545,6 +3563,7 @@
        if (save == NULL)
        {
        PyErr_NoMemory();
        + Py_XDECREF(bytes);
        return NULL;
        }

        @@ -4551,6 +4570,7 @@
        {
        PyErr_SET_STRING(PyExc_ValueError,
        "mark name must be a single character");
        + Py_XDECREF(todecref);
        return NULL;
        }

        @@ -5298,6 +5318,9 @@
        tv->v_type = VAR_UNKNOWN;
        return -1;
        }
        +
        + Py_DECREF(capsule);
        +
        if (py_to_tv(obj, tv, lookup_dict) == -1)
        {
        tv->v_type = VAR_UNKNOWN;
        @@ -5378,13 +5401,13 @@
        tv->vval.v_dict = (((DictionaryObject *)(obj))->dict);
        ++tv->vval.v_dict->dv_refcount;
        }
        - else if (obj->ob_type == &ListType)
        + else if (PyType_IsSubtype(obj->ob_type, &ListType))
        {
        tv->v_type = VAR_LIST;
        tv->vval.v_list = (((ListObject *)(obj))->list);
        ++tv->vval.v_list->lv_refcount;
        }
        - else if (obj->ob_type == &FunctionType)
        + else if (PyType_IsSubtype(obj->ob_type, &FunctionType))
        {
        if (set_string_copy(((FunctionObject *) (obj))->name, tv) == -1)
        return -1;
        diff -r e4cfe82588f5 -r 4a00cd941a88 src/testdir/test86.in
        --- a/src/testdir/test86.in Sun Jun 16 19:17:07 2013 +0400
        +++ b/src/testdir/test86.in Sun Jun 16 22:38:09 2013 +0400
        @@ -11,8 +11,8 @@
        :set noswapfile
        :if !has('python') | e! test.ok | wq! test.out | endif
        :lang C
        +:fun Test()
        :py import vim
        -:fun Test()
        :let l = []
        :py l=vim.bindeval('l')
        :py f=vim.bindeval('function("strlen")')
        @@ -58,6 +58,9 @@
        : $put =string(key) . ' : ' . string(Val)
        : unlet key Val
        :endfor
        +:py del dk
        +:py del di
        +:py del dv
        :"
        :" removing items with del
        :py del l[2]
        @@ -176,12 +179,12 @@
        :unlockvar! l
        :"
        :" Function calls
        -:function New(...)
        -:return ['NewStart']+a:000+['NewEnd']
        -:endfunction
        -:function DictNew(...) dict
        -:return ['DictNewStart']+a:000+['DictNewEnd', self]
        -:endfunction
        +:fun New(...)
        +: return ['NewStart']+a:000+['NewEnd']
        +:endfun
        +:fun DictNew(...) dict
        +: return ['DictNewStart']+a:000+['DictNewEnd', self]
        +:endfun
        :let l=[function('New'), function('DictNew')]
        :py l=vim.bindeval('l')
        :py l.extend(list(l[0](1, 2, 3)))
        @@ -211,6 +214,7 @@
        : $put ='[0.0, 0.0]'
        :endif
        :let messages=[]
        +:delfunction DictNew
        py <<EOF
        d=vim.bindeval('{}')
        m=vim.bindeval('messages')
        @@ -220,15 +224,17 @@
        except:
        m.extend([sys.exc_type.__name__])

        -em('d["abc"]')
        -em('d["abc"]="\\0"')
        -em('d["abc"]=vim')
        +em('d["abc1"]')
        +em('d["abc1"]="\\0"')
        +em('d["abc1"]=vim')
        em('d[""]=1')
        em('d["a\\0b"]=1')
        em('d[u"a\\0b"]=1')

        -em('d.pop("abc")')
        +em('d.pop("abc1")')
        em('d.popitem()')
        +del em
        +del m
        EOF
        :$put =messages
        :unlet messages
        @@ -240,8 +246,8 @@
        : let toput=s.' : '.join(map(['locked', 'scope'], 'v:val.":".pyeval(name.".".v:val)'), ';')
        : $put =toput
        :endfor
        -:silent! let d.abc=1
        -:silent! let dl.abc=1
        +:silent! let d.abc2=1
        +:silent! let dl.abc3=1
        :py d.locked=True
        :py dl.locked=False
        :silent! let d.def=1
        @@ -307,12 +313,15 @@
        time.sleep(0.1)

        t = T()
        +del T
        t.start()
        EOF
        :sleep 1
        :py t.running = False
        :py t.join()
        :py l[0] = t.t > 8 # check if the background thread is working
        +:py del time
        +:py del threading
        :$put =string(l)
        :"
        :" settrace
        @@ -333,6 +342,8 @@
        EOF
        :py sys.settrace(traceit)
        :py trace_main()
        +:py del traceit
        +:py del trace_main
        :py sys.settrace(None)
        :$put =string(l)
        :"
        @@ -363,7 +374,7 @@
        :"
        :" Vars
        :let g:foo = 'bac'
        -:let w:abc = 'def'
        +:let w:abc3 = 'def'
        :let b:baz = 'bar'
        :let t:bar = 'jkl'
        :try
        @@ -372,7 +383,7 @@
        : put =pyeval('vim.vvars[''exception'']')
        :endtry
        :put =pyeval('vim.vars[''foo'']')
        -:put =pyeval('vim.current.window.vars[''abc'']')
        +:put =pyeval('vim.current.window.vars[''abc3'']')
        :put =pyeval('vim.current.buffer.vars[''baz'']')
        :put =pyeval('vim.current.tabpage.vars[''bar'']')
        :"
        @@ -420,16 +431,16 @@
        vim.command('let exc=' + repr(sys.exc_type.__name__))
        return 0
        EOF
        -:function E(s)
        +:fun E(s)
        : python e(vim.eval('a:s'))
        -:endfunction
        -:function Ev(s)
        +:endfun
        +:fun Ev(s)
        : let r=pyeval('ev(vim.eval("a:s"))')
        : if exists('exc')
        : throw exc
        : endif
        : return r
        -:endfunction
        +:endfun
        :py gopts1=vim.options
        :py wopts1=vim.windows[2].options
        :py wopts2=vim.windows[0].options
        @@ -444,7 +455,7 @@
        :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]]
        :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]]
        :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]]
        -:let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc', 0, 0, 1 ]]
        +:let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc4', 0, 0, 1 ]]
        :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]]
        :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]]
        :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]]
        @@ -494,10 +505,27 @@
        : endfor
        : call RecVars(oname)
        :endfor
        +:delfunction RecVars
        +:delfunction E
        +:delfunction Ev
        +:py del ev
        +:py del e
        :only
        :for buf in g:bufs[1:]
        : execute 'bwipeout!' buf
        :endfor
        +:py del gopts1
        +:py del wopts1
        +:py del wopts2
        +:py del wopts3
        +:py del bopts1
        +:py del bopts2
        +:py del bopts3
        +:py del oval1
        +:py del oval2
        +:py del oval3
        +:py del oname
        +:py del invval
        :"
        :" Test buffer object
        :vnew
        @@ -517,7 +545,7 @@
        # Tests BufferAppend and BufferItem
        cb.append(b[0])
        # Tests BufferSlice and BufferAssSlice
        -cb.append('abc') # Will be overwritten
        +cb.append('abc5') # Will be overwritten
        cb[-1:] = b[:-2]
        # Test BufferLength and BufferAssSlice
        cb.append('def') # Will not be overwritten
        @@ -541,13 +569,14 @@
        cb.append(b.name[-11:].replace(os.path.sep, '/'))
        cb.name = old_name
        cb.append(cb.name[-17:].replace(os.path.sep, '/'))
        +del old_name
        # Test CheckBuffer
        for _b in vim.buffers:
        if _b is not cb:
        vim.command('bwipeout! ' + str(_b.number))
        del _b
        cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid)))
        -for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")', 'b.name = "!"'):
        +for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc6")', 'b.name = "!"'):
        try:
        exec(expr)
        except vim.error:
        @@ -557,6 +586,7 @@
        # Should not happen in any case
        cb.append('No exception for ' + expr)
        vim.command('cd .')
        +del b
        EOF
        :augroup BUFS
        : autocmd!
        @@ -598,6 +628,7 @@
        # Check indexing: vim.buffers[number].number == number
        cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b))
        prevnum = b.number
        +del prevnum

        cb.append(str(len(vim.buffers)))

        @@ -621,6 +652,8 @@
        next(i4)
        except StopIteration:
        cb.append('StopIteration')
        +del i4
        +del bnums
        EOF
        :"
        :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects
        @@ -663,7 +696,11 @@
        raise ValueError
        except Exception:
        cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + sys.exc_type.__name__)
        + del aval
        + del attr
        w.cursor = (len(w.buffer), 0)
        +del W
        +del Cursor
        cb.append('Number of windows in current tab page: ' + str(len(vim.windows)))
        if list(vim.windows) != list(vim.current.tabpage.windows):
        cb.append('!!!!!! Windows differ')
        @@ -676,6 +713,7 @@
        cb.append('Current tab page: ' + repr(vim.current.tabpage))
        cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window))
        cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer))
        +del H
        # Assigning: fails
        try:
        vim.current.window = vim.tabpages[0].window
        @@ -687,6 +725,7 @@
        setattr(vim.current, attr, None)
        except TypeError:
        cb.append('Type error at assigning None to vim.current.' + attr)
        +del attr

        # Assigning: success
        vim.current.tabpage = vim.tabpages[-2]
        @@ -702,8 +741,13 @@
        for b in vim.buffers:
        if b is not cb:
        vim.command('bwipeout! ' + str(b.number))
        +del b
        cb.append('w.valid: ' + repr([w.valid for w in ws]))
        cb.append('t.valid: ' + repr([t.valid for t in ts]))
        +del w
        +del t
        +del ts
        +del ws
        EOF
        :tabonly!
        :only!
        @@ -722,6 +766,8 @@
        ('vim.current.tabpage', 'TabPage'),
        ):
        cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr)))
        +del expr
        +del attr
        EOF
        :"
        :" Test __dir__() method
        @@ -747,15 +793,15 @@
        :$put =string(pyeval('vim.Dictionary(a=1)'))
        :$put =string(pyeval('vim.Dictionary(((''a'', 1),))'))
        :$put =string(pyeval('vim.List()'))
        -:$put =string(pyeval('vim.List(iter(''abc''))'))
        +:$put =string(pyeval('vim.List(iter(''abc7''))'))
        :$put =string(pyeval('vim.Function(''tr'')'))
        :"
        :" Test stdout/stderr
        :redir => messages
        -:py sys.stdout.write('abc') ; sys.stdout.write('def')
        -:py sys.stderr.write('abc') ; sys.stderr.write('def')
        -:py sys.stdout.writelines(iter('abc'))
        -:py sys.stderr.writelines(iter('abc'))
        +:py sys.stdout.write('abc8') ; sys.stdout.write('def')
        +:py sys.stderr.write('abc9') ; sys.stderr.write('def')
        +:py sys.stdout.writelines(iter('abcA'))
        +:py sys.stderr.writelines(iter('abcB'))
        :redir END
        :$put =string(substitute(messages, '\d\+', '', 'g'))
        :" Test subclassing
        @@ -776,7 +822,7 @@
        return [super(DupList, self).__getitem__(idx)] * 2

        dl = DupList()
        -dl2 = DupList(iter('abc'))
        +dl2 = DupList(iter('abcC'))
        dl.extend(dl2[0])

        class DupFun(vim.Function):
        @@ -789,6 +835,19 @@
        :$put =string(pyeval('dl'))
        :$put =string(pyeval('dl2'))
        :$put =string(pyeval('df(2)'))
        +:$put =string(pyeval('dl') is# pyeval('dl'))
        +:$put =string(pyeval('dd') is# pyeval('dd'))
        +:$put =string(pyeval('df'))
        +:delfunction Put
        +py << EOF
        +del DupDict
        +del DupList
        +del DupFun
        +del dd
        +del dl
        +del dl2
        +del df
        +EOF
        :"
        :" Test chdir
        py << EOF
        @@ -802,6 +861,7 @@
        os.chdir('testdir')
        cb.append(fnamemodify('.', ':p:h:t'))
        cb.append(vim.eval('@%'))
        +del fnamemodify
        EOF
        :"
        :" Test errors
        @@ -828,11 +888,11 @@
        else:
        cb.append(expr + ':NOT FAILED')
        d = vim.Dictionary()
        -ned = vim.Dictionary(foo='bar', baz='abc')
        +ned = vim.Dictionary(foo='bar', baz='abcD')
        dl = vim.Dictionary(a=1)
        dl.locked = True
        l = vim.List()
        -ll = vim.List('abc')
        +ll = vim.List('abcE')
        ll.locked = True
        f = vim.Function('string')
        fd = vim.Function('F')
        @@ -869,11 +929,11 @@
        # pydict_to_tv
        stringtochars_test(expr % '{%s : 1}')
        if recurse:
        - convertfrompyobject_test(expr % '{"abc" : %s}', False)
        + convertfrompyobject_test(expr % '{"abcF" : %s}', False)
        # pymap_to_tv
        stringtochars_test(expr % 'Mapping({%s : 1})')
        if recurse:
        - convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False)
        + convertfrompyobject_test(expr % 'Mapping({"abcG" : %s})', False)
        # pyseq_to_tv
        iter_test(expr)
        return subexpr_test(expr, 'ConvertFromPyObject', (
        @@ -916,7 +976,7 @@
        raise NotImplementedError

        def keys(self):
        - return list("abc")
        + return list("abcH")

        class FailingMapping(object):
        def __getitem__(self):
        @@ -958,7 +1018,7 @@
        ee('vim.strwidth(1)')
        cb.append("> Dictionary")
        cb.append(">> DictionaryConstructor")
        -ee('vim.Dictionary("abc")')
        +ee('vim.Dictionary("abcI")')
        ##! Not checked: py_dict_alloc failure
        cb.append(">> DictionarySetattr")
        ee('del d.locked')
        @@ -973,6 +1033,7 @@
        ee('dl.pop("a")')
        cb.append(">> DictionaryIterNext")
        ee('for i in ned: ned["a"] = 1')
        +del i
        cb.append(">> DictionaryAssItem")
        ee('dl["b"] = 1')
        stringtochars_test('d[%s] = 1')
        @@ -1002,7 +1063,7 @@
        ee('ll[1] = 2')
        ee('l[1000] = 3')
        cb.append(">> ListAssSlice")
        -ee('ll[1:100] = "abc"')
        +ee('ll[1:100] = "abcJ"')
        #iter_test('l[:] = %s')
        convertfrompyobject_test('l[:] = [%s]')
        cb.append(">> ListConcatInPlace")
        @@ -1033,8 +1094,8 @@
        ee('vim.current.window.buffer = 0')
        ee('vim.current.window.cursor = (100000000, 100000000)')
        ee('vim.current.window.cursor = True')
        -ee('vim.current.window.height = "abc"')
        -ee('vim.current.window.width = "abc"')
        +ee('vim.current.window.height = "abcK"')
        +ee('vim.current.window.width = "abcL"')
        ee('vim.current.window.xxxxxx = True')
        cb.append("> WinList")
        cb.append(">> WinListItem")
        @@ -1044,7 +1105,7 @@
        ee('vim.current.buffer[0] = "\\na"')
        cb.append(">> SetBufferLine (indirect)")
        ee('vim.current.buffer[0] = True')
        -cb.append(">> SetBufferLines (indirect)")
        +cb.append(">> SetBufferLineList (indirect)")
        ee('vim.current.buffer[:] = True')
        ee('vim.current.buffer[:] = ["\\na", "bc"]')
        cb.append(">> InsertBufferLines (indirect)")
        @@ -1062,7 +1123,7 @@
        ee('vim.current.buffer.xxx = True')
        cb.append(">> BufferMark")
        ee('vim.current.buffer.mark(0)')
        -ee('vim.current.buffer.mark("abc")')
        +ee('vim.current.buffer.mark("abcM")')
        ee('vim.current.buffer.mark("!")')
        cb.append(">> BufferRange")
        ee('vim.current.buffer.range(1, 2, 3)')
        @@ -1079,7 +1140,28 @@
        ee('vim.current.window = True')
        ee('vim.current.tabpage = True')
        ee('vim.current.xxx = True')
        +del d
        +del ned
        +del dl
        +del l
        +del ll
        +del f
        +del fd
        +del fdel
        +del subexpr_test
        +del stringtochars_test
        +del Mapping
        +del convertfrompyobject_test
        +del convertfrompymapping_test
        +del iter_test
        +del FailingTrue
        +del FailingIter
        +del FailingIterNext
        +del FailingMapping
        +del FailingMappingKey
        +del FailingList
        EOF
        +:delfunction F
        :"
        :" Test import
        py << EOF
        @@ -1093,6 +1175,10 @@
        cb.append(before.dir)
        import after
        cb.append(after.dir)
        +del before
        +del after
        +del d
        +del ddir
        EOF
        :"
        :" Test exceptions
        @@ -1101,18 +1187,48 @@
        :endfun
        py << EOF
        Exe = vim.bindeval('function("Exe")')
        -ee('vim.command("throw \'abc\'")')
        +ee('vim.command("throw \'abcN\'")')
        ee('Exe("throw \'def\'")')
        ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
        ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
        ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
        ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
        +del Exe
        +EOF
        +:delfunction Exe
        +:"
        +:" Cleanup
        +py << EOF
        +del cb
        +del ee
        +del sys
        +del os
        +del vim
        EOF
        :endfun
        :"
        -:call Test()
        +:fun RunTest()
        +:let checkrefs = !empty($PYTHONDUMPREFS)
        +:let start = getline(1, '$')
        +:for i in range(checkrefs ? 10 : 1)
        +: if i != 0
        +: %d _
        +: call setline(1, start)
        +: endif
        +: call Test()
        +: if i == 0
        +: let result = getline(1, '$')
        +: endif
        +:endfor
        +:if checkrefs
        +: %d _
        +: call setline(1, result)
        +:endif
        +:endfun
        :"
        -:delfunc Test
        +:call RunTest()
        +:delfunction RunTest
        +:delfunction Test
        :call garbagecollect(1)
        :"
        :/^start:/,$wq! test.out
        diff -r e4cfe82588f5 -r 4a00cd941a88 src/testdir/test86.ok
        --- a/src/testdir/test86.ok Sun Jun 16 19:17:07 2013 +0400
        +++ b/src/testdir/test86.ok Sun Jun 16 22:38:09 2013 +0400
        @@ -68,7 +68,7 @@
        dl : locked:1;scope:0
        v: : locked:2;scope:1
        g: : locked:0;scope:2
        -d:{'abc': 1}
        +d:{'abc2': 1}
        dl:{'def': 1}
        l : locked:0
        ll : locked:1
        @@ -202,12 +202,12 @@
        B: 1:3 2:5 3:2 4:8
        >>> colorcolumn
        p/gopts1! KeyError
        - inv: 'abc'! KeyError
        + inv: 'abc4'! KeyError
        gopts1! KeyError
        p/wopts1: ''
        - inv: 'abc'! error
        + inv: 'abc4'! error
        p/bopts1! KeyError
        - inv: 'abc'! KeyError
        + inv: 'abc4'! KeyError
        bopts1! KeyError
        bopts2! KeyError
        bopts3! KeyError
        @@ -415,20 +415,23 @@
        {'a': 1}
        {'a': 1}
        []
        -['a', 'b', 'c']
        +['a', 'b', 'c', '7']
        function('tr')
        '
        abcdef
        line :
        abcdef
        -abc
        +abcA
        line :
        -abc'
        +abcB'
        ['a', 'dup_a']
        ['a', 'a']
        -['a', 'b', 'c']
        +['a', 'b', 'c', 'C']
        [2, 2]
        [2, 2]
        +1
        +1
        +function('Put')
        testdir
        test86.in
        src
        @@ -456,7 +459,7 @@
        vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',)
        > Dictionary
        >> DictionaryConstructor
        -vim.Dictionary("abc"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
        +vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
        >> DictionarySetattr
        del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',)
        d.locked = FailingTrue():NotImplementedError:()
        @@ -486,52 +489,52 @@
        d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',)
        d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}}
        -d["a"] = {"abc" : {1 : 1}}:TypeError:('expected str() or unicode() instance, but got int',)
        -d["a"] = {"abc" : {u"\0" : 1}}:TypeError:('expected string without null bytes',)
        -d["a"] = {"abc" : {"\0" : 1}}:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d["a"] = {"abcF" : {%s : 1}}
        +d["a"] = {"abcF" : {1 : 1}}:TypeError:('expected str() or unicode() instance, but got int',)
        +d["a"] = {"abcF" : {u"\0" : 1}}:TypeError:('expected string without null bytes',)
        +d["a"] = {"abcF" : {"\0" : 1}}:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})}
        -d["a"] = {"abc" : Mapping({1 : 1})}:TypeError:('expected str() or unicode() instance, but got int',)
        -d["a"] = {"abc" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',)
        -d["a"] = {"abc" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d["a"] = {"abcF" : Mapping({%s : 1})}
        +d["a"] = {"abcF" : Mapping({1 : 1})}:TypeError:('expected str() or unicode() instance, but got int',)
        +d["a"] = {"abcF" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',)
        +d["a"] = {"abcF" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d["a"] = {"abc" : %s}
        -d["a"] = {"abc" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',)
        -d["a"] = {"abc" : FailingIterNext()}:NotImplementedError:()
        +>>> Testing *Iter* using d["a"] = {"abcF" : %s}
        +d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',)
        +d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s}
        -d["a"] = {"abc" : None}:TypeError:('unable to convert NoneType to vim structure',)
        -d["a"] = {"abc" : {"": 1}}:ValueError:('empty keys are not allowed',)
        -d["a"] = {"abc" : {u"": 1}}:ValueError:('empty keys are not allowed',)
        -d["a"] = {"abc" : FailingMapping()}:NotImplementedError:()
        -d["a"] = {"abc" : FailingMappingKey()}:NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s}
        +d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',)
        +d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',)
        +d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
        +d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:()
        +d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
        d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
        d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',)
        d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}})
        -d["a"] = Mapping({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        -d["a"] = Mapping({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        -d["a"] = Mapping({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d["a"] = Mapping({"abcG" : {%s : 1}})
        +d["a"] = Mapping({"abcG" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        +d["a"] = Mapping({"abcG" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        +d["a"] = Mapping({"abcG" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})})
        -d["a"] = Mapping({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        -d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        -d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d["a"] = Mapping({"abcG" : Mapping({%s : 1})})
        +d["a"] = Mapping({"abcG" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        +d["a"] = Mapping({"abcG" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        +d["a"] = Mapping({"abcG" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d["a"] = Mapping({"abc" : %s})
        -d["a"] = Mapping({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        -d["a"] = Mapping({"abc" : FailingIterNext()}):NotImplementedError:()
        +>>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s})
        +d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        +d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s})
        -d["a"] = Mapping({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',)
        -d["a"] = Mapping({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',)
        -d["a"] = Mapping({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        -d["a"] = Mapping({"abc" : FailingMapping()}):NotImplementedError:()
        -d["a"] = Mapping({"abc" : FailingMappingKey()}):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s})
        +d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',)
        +d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',)
        +d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        +d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:()
        +d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using d["a"] = %s
        d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',)
        @@ -554,52 +557,52 @@
        d.update({u"\0" : 1}):TypeError:('expected string without null bytes',)
        d.update({"\0" : 1}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update({"abc" : {%s : 1}})
        -d.update({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        -d.update({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update({"abcF" : {%s : 1}})
        +d.update({"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update({"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        +d.update({"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})})
        -d.update({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        -d.update({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update({"abcF" : Mapping({%s : 1})})
        +d.update({"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update({"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        +d.update({"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d.update({"abc" : %s})
        -d.update({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        -d.update({"abc" : FailingIterNext()}):NotImplementedError:()
        +>>> Testing *Iter* using d.update({"abcF" : %s})
        +d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        +d.update({"abcF" : FailingIterNext()}):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d.update({"abc" : %s})
        -d.update({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',)
        -d.update({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',)
        -d.update({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        -d.update({"abc" : FailingMapping()}):NotImplementedError:()
        -d.update({"abc" : FailingMappingKey()}):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d.update({"abcF" : %s})
        +d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
        +d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
        +d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        +d.update({"abcF" : FailingMapping()}):NotImplementedError:()
        +d.update({"abcF" : FailingMappingKey()}):NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using d.update(Mapping({%s : 1}))
        d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
        d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',)
        d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}}))
        -d.update(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',)
        -d.update(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update(Mapping({"abcG" : {%s : 1}}))
        +d.update(Mapping({"abcG" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update(Mapping({"abcG" : {u"\0" : 1}})):TypeError:('expected string without null bytes',)
        +d.update(Mapping({"abcG" : {"\0" : 1}})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})}))
        -d.update(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',)
        -d.update(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update(Mapping({"abcG" : Mapping({%s : 1})}))
        +d.update(Mapping({"abcG" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update(Mapping({"abcG" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',)
        +d.update(Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d.update(Mapping({"abc" : %s}))
        -d.update(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
        -d.update(Mapping({"abc" : FailingIterNext()})):NotImplementedError:()
        +>>> Testing *Iter* using d.update(Mapping({"abcG" : %s}))
        +d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
        +d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s}))
        -d.update(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',)
        -d.update(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',)
        -d.update(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',)
        -d.update(Mapping({"abc" : FailingMapping()})):NotImplementedError:()
        -d.update(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s}))
        +d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
        +d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
        +d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
        +d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
        +d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using d.update(%s)
        d.update(FailingIter()):NotImplementedError:()
        @@ -622,52 +625,52 @@
        d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',)
        d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),))
        -d.update((("a", {"abc" : {1 : 1}}),)):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update((("a", {"abc" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',)
        -d.update((("a", {"abc" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update((("a", {"abcF" : {%s : 1}}),))
        +d.update((("a", {"abcF" : {1 : 1}}),)):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update((("a", {"abcF" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',)
        +d.update((("a", {"abcF" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),))
        -d.update((("a", {"abc" : Mapping({1 : 1})}),)):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',)
        -d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update((("a", {"abcF" : Mapping({%s : 1})}),))
        +d.update((("a", {"abcF" : Mapping({1 : 1})}),)):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update((("a", {"abcF" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',)
        +d.update((("a", {"abcF" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d.update((("a", {"abc" : %s}),))
        -d.update((("a", {"abc" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',)
        -d.update((("a", {"abc" : FailingIterNext()}),)):NotImplementedError:()
        +>>> Testing *Iter* using d.update((("a", {"abcF" : %s}),))
        +d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',)
        +d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),))
        -d.update((("a", {"abc" : None}),)):TypeError:('unable to convert NoneType to vim structure',)
        -d.update((("a", {"abc" : {"": 1}}),)):ValueError:('empty keys are not allowed',)
        -d.update((("a", {"abc" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
        -d.update((("a", {"abc" : FailingMapping()}),)):NotImplementedError:()
        -d.update((("a", {"abc" : FailingMappingKey()}),)):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),))
        +d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',)
        +d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',)
        +d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
        +d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:()
        +d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
        d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',)
        d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',)
        d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),))
        -d.update((("a", Mapping({"abc" : {1 : 1}})),)):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',)
        -d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update((("a", Mapping({"abcG" : {%s : 1}})),))
        +d.update((("a", Mapping({"abcG" : {1 : 1}})),)):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update((("a", Mapping({"abcG" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',)
        +d.update((("a", Mapping({"abcG" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),))
        -d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):TypeError:('expected str() or unicode() instance, but got int',)
        -d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',)
        -d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using d.update((("a", Mapping({"abcG" : Mapping({%s : 1})})),))
        +d.update((("a", Mapping({"abcG" : Mapping({1 : 1})})),)):TypeError:('expected str() or unicode() instance, but got int',)
        +d.update((("a", Mapping({"abcG" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',)
        +d.update((("a", Mapping({"abcG" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),))
        -d.update((("a", Mapping({"abc" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',)
        -d.update((("a", Mapping({"abc" : FailingIterNext()})),)):NotImplementedError:()
        +>>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),))
        +d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',)
        +d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),))
        -d.update((("a", Mapping({"abc" : None})),)):TypeError:('unable to convert NoneType to vim structure',)
        -d.update((("a", Mapping({"abc" : {"": 1}})),)):ValueError:('empty keys are not allowed',)
        -d.update((("a", Mapping({"abc" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
        -d.update((("a", Mapping({"abc" : FailingMapping()})),)):NotImplementedError:()
        -d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),))
        +d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',)
        +d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',)
        +d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
        +d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:()
        +d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using d.update((("a", %s),))
        d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',)
        @@ -693,52 +696,52 @@
        vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
        vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}])
        -vim.List([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',)
        -vim.List([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',)
        -vim.List([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using vim.List([{"abcF" : {%s : 1}}])
        +vim.List([{"abcF" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',)
        +vim.List([{"abcF" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',)
        +vim.List([{"abcF" : {"\0" : 1}}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}])
        -vim.List([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',)
        -vim.List([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',)
        -vim.List([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using vim.List([{"abcF" : Mapping({%s : 1})}])
        +vim.List([{"abcF" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',)
        +vim.List([{"abcF" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',)
        +vim.List([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using vim.List([{"abc" : %s}])
        -vim.List([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
        -vim.List([{"abc" : FailingIterNext()}]):NotImplementedError:()
        +>>> Testing *Iter* using vim.List([{"abcF" : %s}])
        +vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
        +vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}])
        -vim.List([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',)
        -vim.List([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',)
        -vim.List([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
        -vim.List([{"abc" : FailingMapping()}]):NotImplementedError:()
        -vim.List([{"abc" : FailingMappingKey()}]):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
        +vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
        +vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
        +vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
        +vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:()
        +vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
        vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
        vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',)
        vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})])
        -vim.List([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',)
        -vim.List([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',)
        -vim.List([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using vim.List([Mapping({"abcG" : {%s : 1}})])
        +vim.List([Mapping({"abcG" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',)
        +vim.List([Mapping({"abcG" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',)
        +vim.List([Mapping({"abcG" : {"\0" : 1}})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})])
        -vim.List([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',)
        -vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',)
        -vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using vim.List([Mapping({"abcG" : Mapping({%s : 1})})])
        +vim.List([Mapping({"abcG" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',)
        +vim.List([Mapping({"abcG" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',)
        +vim.List([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using vim.List([Mapping({"abc" : %s})])
        -vim.List([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
        -vim.List([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:()
        +>>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})])
        +vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
        +vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})])
        -vim.List([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',)
        -vim.List([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',)
        -vim.List([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
        -vim.List([Mapping({"abc" : FailingMapping()})]):NotImplementedError:()
        -vim.List([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
        +vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
        +vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
        +vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
        +vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
        +vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using vim.List([%s])
        vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
        @@ -757,58 +760,58 @@
        ll[1] = 2:error:('list is locked',)
        l[1000] = 3:IndexError:('list index out of range',)
        >> ListAssSlice
        -ll[1:100] = "abc":error:('list is locked',)
        +ll[1:100] = "abcJ":error:('list is locked',)
        >>> Testing StringToChars using l[:] = [{%s : 1}]
        l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',)
        l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',)
        l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}]
        -l[:] = [{"abc" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',)
        -l[:] = [{"abc" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',)
        -l[:] = [{"abc" : {"\0" : 1}}]:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l[:] = [{"abcF" : {%s : 1}}]
        +l[:] = [{"abcF" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',)
        +l[:] = [{"abcF" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',)
        +l[:] = [{"abcF" : {"\0" : 1}}]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}]
        -l[:] = [{"abc" : Mapping({1 : 1})}]:TypeError:('expected str() or unicode() instance, but got int',)
        -l[:] = [{"abc" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',)
        -l[:] = [{"abc" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l[:] = [{"abcF" : Mapping({%s : 1})}]
        +l[:] = [{"abcF" : Mapping({1 : 1})}]:TypeError:('expected str() or unicode() instance, but got int',)
        +l[:] = [{"abcF" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',)
        +l[:] = [{"abcF" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using l[:] = [{"abc" : %s}]
        -l[:] = [{"abc" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',)
        -l[:] = [{"abc" : FailingIterNext()}]:NotImplementedError:()
        +>>> Testing *Iter* using l[:] = [{"abcF" : %s}]
        +l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',)
        +l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}]
        -l[:] = [{"abc" : None}]:TypeError:('unable to convert NoneType to vim structure',)
        -l[:] = [{"abc" : {"": 1}}]:ValueError:('empty keys are not allowed',)
        -l[:] = [{"abc" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
        -l[:] = [{"abc" : FailingMapping()}]:NotImplementedError:()
        -l[:] = [{"abc" : FailingMappingKey()}]:NotImplementedError:()
        +>>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}]
        +l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',)
        +l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',)
        +l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
        +l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:()
        +l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
        l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',)
        l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',)
        l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})]
        -l[:] = [Mapping({"abc" : {1 : 1}})]:TypeError:('expected str() or unicode() instance, but got int',)
        -l[:] = [Mapping({"abc" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',)
        -l[:] = [Mapping({"abc" : {"\0" : 1}})]:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l[:] = [Mapping({"abcG" : {%s : 1}})]
        +l[:] = [Mapping({"abcG" : {1 : 1}})]:TypeError:('expected str() or unicode() instance, but got int',)
        +l[:] = [Mapping({"abcG" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',)
        +l[:] = [Mapping({"abcG" : {"\0" : 1}})]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})]
        -l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:TypeError:('expected str() or unicode() instance, but got int',)
        -l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',)
        -l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l[:] = [Mapping({"abcG" : Mapping({%s : 1})})]
        +l[:] = [Mapping({"abcG" : Mapping({1 : 1})})]:TypeError:('expected str() or unicode() instance, but got int',)
        +l[:] = [Mapping({"abcG" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',)
        +l[:] = [Mapping({"abcG" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})]
        -l[:] = [Mapping({"abc" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',)
        -l[:] = [Mapping({"abc" : FailingIterNext()})]:NotImplementedError:()
        +>>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})]
        +l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',)
        +l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})]
        -l[:] = [Mapping({"abc" : None})]:TypeError:('unable to convert NoneType to vim structure',)
        -l[:] = [Mapping({"abc" : {"": 1}})]:ValueError:('empty keys are not allowed',)
        -l[:] = [Mapping({"abc" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
        -l[:] = [Mapping({"abc" : FailingMapping()})]:NotImplementedError:()
        -l[:] = [Mapping({"abc" : FailingMappingKey()})]:NotImplementedError:()
        +>>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})]
        +l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',)
        +l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',)
        +l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
        +l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:()
        +l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using l[:] = [%s]
        l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',)
        @@ -827,52 +830,52 @@
        l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
        l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}])
        -l.extend([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',)
        -l.extend([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',)
        -l.extend([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l.extend([{"abcF" : {%s : 1}}])
        +l.extend([{"abcF" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',)
        +l.extend([{"abcF" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',)
        +l.extend([{"abcF" : {"\0" : 1}}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}])
        -l.extend([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',)
        -l.extend([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',)
        -l.extend([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l.extend([{"abcF" : Mapping({%s : 1})}])
        +l.extend([{"abcF" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',)
        +l.extend([{"abcF" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',)
        +l.extend([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using l.extend([{"abc" : %s}])
        -l.extend([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
        -l.extend([{"abc" : FailingIterNext()}]):NotImplementedError:()
        +>>> Testing *Iter* using l.extend([{"abcF" : %s}])
        +l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
        +l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}])
        -l.extend([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',)
        -l.extend([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',)
        -l.extend([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
        -l.extend([{"abc" : FailingMapping()}]):NotImplementedError:()
        -l.extend([{"abc" : FailingMappingKey()}]):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}])
        +l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
        +l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
        +l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
        +l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:()
        +l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
        l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
        l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',)
        l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})])
        -l.extend([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',)
        -l.extend([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',)
        -l.extend([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l.extend([Mapping({"abcG" : {%s : 1}})])
        +l.extend([Mapping({"abcG" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',)
        +l.extend([Mapping({"abcG" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',)
        +l.extend([Mapping({"abcG" : {"\0" : 1}})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})])
        -l.extend([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',)
        -l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',)
        -l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using l.extend([Mapping({"abcG" : Mapping({%s : 1})})])
        +l.extend([Mapping({"abcG" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',)
        +l.extend([Mapping({"abcG" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',)
        +l.extend([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using l.extend([Mapping({"abc" : %s})])
        -l.extend([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
        -l.extend([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:()
        +>>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})])
        +l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
        +l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})])
        -l.extend([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',)
        -l.extend([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',)
        -l.extend([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
        -l.extend([Mapping({"abc" : FailingMapping()})]):NotImplementedError:()
        -l.extend([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})])
        +l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
        +l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
        +l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
        +l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
        +l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using l.extend([%s])
        l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
        @@ -900,52 +903,52 @@
        f({u"\0" : 1}):TypeError:('expected string without null bytes',)
        f({"\0" : 1}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using f({"abc" : {%s : 1}})
        -f({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        -f({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        -f({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using f({"abcF" : {%s : 1}})
        +f({"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        +f({"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        +f({"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using f({"abc" : Mapping({%s : 1})})
        -f({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        -f({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        -f({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using f({"abcF" : Mapping({%s : 1})})
        +f({"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        +f({"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        +f({"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using f({"abc" : %s})
        -f({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        -f({"abc" : FailingIterNext()}):NotImplementedError:()
        +>>> Testing *Iter* using f({"abcF" : %s})
        +f({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        +f({"abcF" : FailingIterNext()}):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using f({"abc" : %s})
        -f({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',)
        -f({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',)
        -f({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        -f({"abc" : FailingMapping()}):NotImplementedError:()
        -f({"abc" : FailingMappingKey()}):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using f({"abcF" : %s})
        +f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
        +f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
        +f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
        +f({"abcF" : FailingMapping()}):NotImplementedError:()
        +f({"abcF" : FailingMappingKey()}):NotImplementedError:()
        <<< Finished
        >>> Testing StringToChars using f(Mapping({%s : 1}))
        f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
        f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',)
        f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}}))
        -f(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',)
        -f(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',)
        -f(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using f(Mapping({"abcG" : {%s : 1}}))
        +f(Mapping({"abcG" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',)
        +f(Mapping({"abcG" : {u"\0" : 1}})):TypeError:('expected string without null bytes',)
        +f(Mapping({"abcG" : {"\0" : 1}})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})}))
        -f(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',)
        -f(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',)
        -f(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using f(Mapping({"abcG" : Mapping({%s : 1})}))
        +f(Mapping({"abcG" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',)
        +f(Mapping({"abcG" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',)
        +f(Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using f(Mapping({"abc" : %s}))
        -f(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
        -f(Mapping({"abc" : FailingIterNext()})):NotImplementedError:()
        +>>> Testing *Iter* using f(Mapping({"abcG" : %s}))
        +f(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
        +f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:()
        <<< Finished
        ->>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s}))
        -f(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',)
        -f(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',)
        -f(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',)
        -f(Mapping({"abc" : FailingMapping()})):NotImplementedError:()
        -f(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:()
        +>>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s}))
        +f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
        +f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
        +f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
        +f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
        +f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
        <<< Finished
        >>> Testing *Iter* using f(%s)
        f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',)
        @@ -963,52 +966,52 @@
        fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',)
        fd(self={"\0" : 1}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using fd(self={"abc" : {%s : 1}})
        -fd(self={"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        -fd(self={"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        -fd(self={"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using fd(self={"abcF" : {%s : 1}})
        +fd(self={"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',)
        +fd(self={"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',)
        +fd(self={"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})})
        -fd(self={"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        -fd(self={"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        -fd(self={"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        +>>> Testing StringToChars using fd(self={"abcF" : Mapping({%s : 1})})
        +fd(self={"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',)
        +fd(self={"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',)
        +fd(self={"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',)
        <<< Finished
        ->>> Testing *Iter* using fd(self={"abc" : %s})
        -fd(self={"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
        -fd(self={"abc" : FailingIterNext()}):NotImplementedError:()
        +>>> Testing *Iter* using fd(self={"abcF" : %s})
        +fd(self={"abcF" :<br/><br/>(Message over 64 KB, truncated)
      • ZyX
        Note: posting here regardless of the Note: below in the commit message because the child of this changeset may (most likely may not, but change is at the code
        Message 3 of 25 , Jun 19, 2013
        • 0 Attachment
          Note: posting here regardless of the Note: below in the commit message because the child of this changeset may (most likely may not, but change is at the code that shows the error) solve problem with test86/test87 (will come next patch). Have not actually checked though (I mean, have not actually checked whether it does solve this problem), but it indeed does solve another problem I found out.

          # HG changeset patch
          # User ZyX <kp-pav@...>
          # Date 1371441247 -14400
          # Mon Jun 17 07:54:07 2013 +0400
          # Branch python-fixes
          # Node ID 42e166b5c6ff07cd7810780b1d3704b8ce61bac0
          # Parent 4a00cd941a883917f6d740f9f06aca7baadcb45e
          Add NUMBER_UNSIGNED to WindowSetattr(, "width"|"height")
          And more tests

          Note: in ee('import failing') it was expected to raise NotImplementedError, but
          actually raises ImportError

          diff -r 4a00cd941a88 -r 42e166b5c6ff src/if_py_both.h
          --- a/src/if_py_both.h Sun Jun 16 22:38:09 2013 +0400
          +++ b/src/if_py_both.h Mon Jun 17 07:54:07 2013 +0400
          @@ -3357,7 +3357,7 @@
          long height;
          win_T *savewin;

          - if (NumberToLong(valObject, &height, NUMBER_INT))
          + if (NumberToLong(valObject, &height, NUMBER_INT|NUMBER_UNSIGNED))
          return -1;

          #ifdef FEAT_GUI
          @@ -3380,7 +3380,7 @@
          long width;
          win_T *savewin;

          - if (NumberToLong(valObject, &width, NUMBER_INT))
          + if (NumberToLong(valObject, &width, NUMBER_INT|NUMBER_UNSIGNED))
          return -1;

          #ifdef FEAT_GUI
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/pythonx/failing.py
          --- /dev/null Thu Jan 01 00:00:00 1970 +0000
          +++ b/src/testdir/pythonx/failing.py Mon Jun 17 07:54:07 2013 +0400
          @@ -0,0 +1,1 @@
          +raise NotImplementedError
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/pythonx/failing_import.py
          --- /dev/null Thu Jan 01 00:00:00 1970 +0000
          +++ b/src/testdir/pythonx/failing_import.py Mon Jun 17 07:54:07 2013 +0400
          @@ -0,0 +1,1 @@
          +raise ImportError
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/test86.in
          --- a/src/testdir/test86.in Sun Jun 16 22:38:09 2013 +0400
          +++ b/src/testdir/test86.in Mon Jun 17 07:54:07 2013 +0400
          @@ -342,9 +342,9 @@
          EOF
          :py sys.settrace(traceit)
          :py trace_main()
          +:py sys.settrace(None)
          :py del traceit
          :py del trace_main
          -:py sys.settrace(None)
          :$put =string(l)
          :"
          :" Slice
          @@ -942,6 +942,7 @@
          '{u"": 1}', # Same, but with unicode object
          'FailingMapping()', #
          'FailingMappingKey()', #
          + 'FailingNumber()', #
          ))

          def convertfrompymapping_test(expr):
          @@ -956,6 +957,15 @@
          'FailingIterNext()',
          ))

          +def number_test(expr, natural=False, unsigned=False):
          + if natural:
          + unsigned = True
          + return subexpr_test(expr, 'NumberToLong', (
          + '[]',
          + 'None',
          + ) + (unsigned and ('-1',) or ())
          + + (natural and ('0',) or ()))
          +
          class FailingTrue(object):
          def __nonzero__(self):
          raise NotImplementedError
          @@ -992,30 +1002,59 @@
          else:
          return super(FailingList, self).__getitem__(idx)

          +class NoArgsCall(object):
          + def __call__(self):
          + pass
          +
          +class FailingCall(object):
          + def __call__(self, path):
          + raise NotImplementedError
          +
          +class FailingNumber(object):
          + def __int__(self):
          + raise NotImplementedError
          +
          cb.append("> Output")
          cb.append(">> OutputSetattr")
          ee('del sys.stdout.softspace')
          -ee('sys.stdout.softspace = []')
          +number_test('sys.stdout.softspace = %s', unsigned=True)
          +number_test('sys.stderr.softspace = %s', unsigned=True)
          ee('sys.stdout.attr = None')
          cb.append(">> OutputWrite")
          ee('sys.stdout.write(None)')
          cb.append(">> OutputWriteLines")
          ee('sys.stdout.writelines(None)')
          ee('sys.stdout.writelines([1])')
          -#iter_test('sys.stdout.writelines(%s)')
          +iter_test('sys.stdout.writelines(%s)')
          cb.append("> VimCommand")
          -ee('vim.command(1)')
          +stringtochars_test('vim.command(%s)')
          +ee('vim.command("", 2)')
          #! Not checked: vim->python exceptions translating: checked later
          cb.append("> VimToPython")
          #! Not checked: everything: needs errors in internal python functions
          cb.append("> VimEval")
          -ee('vim.eval(1)')
          +stringtochars_test('vim.eval(%s)')
          +ee('vim.eval("", FailingTrue())')
          #! Not checked: everything: needs errors in internal python functions
          cb.append("> VimEvalPy")
          -ee('vim.bindeval(1)')
          +stringtochars_test('vim.bindeval(%s)')
          +ee('vim.eval("", 2)')
          #! Not checked: vim->python exceptions translating: checked later
          cb.append("> VimStrwidth")
          -ee('vim.strwidth(1)')
          +stringtochars_test('vim.strwidth(%s)')
          +cb.append("> VimForeachRTP")
          +ee('vim.foreach_rtp(None)')
          +ee('vim.foreach_rtp(NoArgsCall())')
          +ee('vim.foreach_rtp(FailingCall())')
          +ee('vim.foreach_rtp(int, 2)')
          +cb.append('> import')
          +old_rtp = vim.options['rtp']
          +vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
          +ee('import xxx_no_such_module_xxx')
          +ee('import failing_import')
          +ee('import failing')
          +vim.options['rtp'] = old_rtp
          +del old_rtp
          cb.append("> Dictionary")
          cb.append(">> DictionaryConstructor")
          ee('vim.Dictionary("abcI")')
          @@ -1043,7 +1082,7 @@
          cb.append(">>> iter")
          ee('d.update(FailingMapping())')
          ee('d.update([FailingIterNext()])')
          -#iter_test('d.update(%s)')
          +iter_test('d.update(%s)')
          convertfrompyobject_test('d.update(%s)')
          stringtochars_test('d.update(((%s, 0),))')
          convertfrompyobject_test('d.update((("a", %s),))')
          @@ -1055,7 +1094,7 @@
          cb.append(">> ListConstructor")
          ee('vim.List(1, 2)')
          ee('vim.List(a=1)')
          -#iter_test('vim.List(%s)')
          +iter_test('vim.List(%s)')
          convertfrompyobject_test('vim.List([%s])')
          cb.append(">> ListItem")
          ee('l[1000]')
          @@ -1064,10 +1103,10 @@
          ee('l[1000] = 3')
          cb.append(">> ListAssSlice")
          ee('ll[1:100] = "abcJ"')
          -#iter_test('l[:] = %s')
          +iter_test('l[:] = %s')
          convertfrompyobject_test('l[:] = [%s]')
          cb.append(">> ListConcatInPlace")
          -#iter_test('l.extend(%s)')
          +iter_test('l.extend(%s)')
          convertfrompyobject_test('l.extend([%s])')
          cb.append(">> ListSetattr")
          ee('del l.locked')
          @@ -1094,14 +1133,15 @@
          ee('vim.current.window.buffer = 0')
          ee('vim.current.window.cursor = (100000000, 100000000)')
          ee('vim.current.window.cursor = True')
          -ee('vim.current.window.height = "abcK"')
          -ee('vim.current.window.width = "abcL"')
          +number_test('vim.current.window.height = %s', unsigned=True)
          +number_test('vim.current.window.width = %s', unsigned=True)
          ee('vim.current.window.xxxxxx = True')
          cb.append("> WinList")
          cb.append(">> WinListItem")
          ee('vim.windows[1000]')
          cb.append("> Buffer")
          cb.append(">> StringToLine (indirect)")
          +ee('vim.current.buffer[0] = u"\\na"')
          ee('vim.current.buffer[0] = "\\na"')
          cb.append(">> SetBufferLine (indirect)")
          ee('vim.current.buffer[0] = True')
          @@ -1129,8 +1169,8 @@
          ee('vim.current.buffer.range(1, 2, 3)')
          cb.append("> BufMap")
          cb.append(">> BufMapItem")
          -ee('vim.buffers[None]')
          ee('vim.buffers[100000000]')
          +number_test('vim.buffers[%s]', natural=True)
          cb.append("> Current")
          cb.append(">> CurrentGetattr")
          ee('vim.current.xxx')
          @@ -1154,12 +1194,16 @@
          del convertfrompyobject_test
          del convertfrompymapping_test
          del iter_test
          +del number_test
          del FailingTrue
          del FailingIter
          del FailingIterNext
          del FailingMapping
          del FailingMappingKey
          del FailingList
          +del NoArgsCall
          +del FailingCall
          +del FailingNumber
          EOF
          :delfunction F
          :"
          @@ -1168,6 +1212,16 @@
          sys.path.insert(0, os.path.join(os.getcwd(), 'python_before'))
          sys.path.append(os.path.join(os.getcwd(), 'python_after'))
          vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
          +l = []
          +def callback(path):
          + l.append(path[-len('/testdir'):])
          +vim.foreach_rtp(callback)
          +cb.append(repr(l))
          +del l
          +def callback(path):
          + return path[-len('/testdir'):]
          +cb.append(repr(vim.foreach_rtp(callback)))
          +del callback
          from module import dir as d
          from modulex import ddir
          cb.append(d + ',' + ddir)
          @@ -1175,10 +1229,19 @@
          cb.append(before.dir)
          import after
          cb.append(after.dir)
          +import topmodule as tm
          +import topmodule.submodule as tms
          +import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss
          +cb.append(tm.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/__init__.py'):])
          +cb.append(tms.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/__init__.py'):])
          +cb.append(tmsss.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):])
          del before
          del after
          del d
          del ddir
          +del tm
          +del tms
          +del tmsss
          EOF
          :"
          :" Test exceptions
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/test86.ok
          --- a/src/testdir/test86.ok Sun Jun 16 22:38:09 2013 +0400
          +++ b/src/testdir/test86.ok Mon Jun 17 07:54:07 2013 +0400
          @@ -441,22 +441,63 @@
          > Output
          >> OutputSetattr
          del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",)
          +>>> Testing NumberToLong using sys.stdout.softspace = %s
          sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
          +sys.stdout.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
          +sys.stdout.softspace = -1:ValueError:('number must be greater or equal to zero',)
          +<<< Finished
          +>>> Testing NumberToLong using sys.stderr.softspace = %s
          +sys.stderr.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
          +sys.stderr.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
          +sys.stderr.softspace = -1:ValueError:('number must be greater or equal to zero',)
          +<<< Finished
          sys.stdout.attr = None:AttributeError:('invalid attribute: attr',)
          >> OutputWrite
          sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',)
          >> OutputWriteLines
          sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",)
          sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',)
          +>>> Testing *Iter* using sys.stdout.writelines(%s)
          +sys.stdout.writelines(FailingIter()):NotImplementedError:()
          +sys.stdout.writelines(FailingIterNext()):NotImplementedError:()
          +<<< Finished
          > VimCommand
          +>>> Testing StringToChars using vim.command(%s)
          vim.command(1):TypeError:('expected str() or unicode() instance, but got int',)
          +vim.command(u"\0"):TypeError:('expected string without null bytes',)
          +vim.command("\0"):TypeError:('expected string without null bytes',)
          +<<< Finished
          +vim.command("", 2):TypeError:('command() takes exactly one argument (2 given)',)
          > VimToPython
          > VimEval
          +>>> Testing StringToChars using vim.eval(%s)
          vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',)
          +vim.eval(u"\0"):TypeError:('expected string without null bytes',)
          +vim.eval("\0"):TypeError:('expected string without null bytes',)
          +<<< Finished
          +vim.eval("", FailingTrue()):TypeError:('function takes exactly 1 argument (2 given)',)
          > VimEvalPy
          +>>> Testing StringToChars using vim.bindeval(%s)
          vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',)
          +vim.bindeval(u"\0"):TypeError:('expected string without null bytes',)
          +vim.bindeval("\0"):TypeError:('expected string without null bytes',)
          +<<< Finished
          +vim.eval("", 2):TypeError:('function takes exactly 1 argument (2 given)',)
          > VimStrwidth
          +>>> Testing StringToChars using vim.strwidth(%s)
          vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',)
          +vim.strwidth(u"\0"):TypeError:('expected string without null bytes',)
          +vim.strwidth("\0"):TypeError:('expected string without null bytes',)
          +<<< Finished
          +> VimForeachRTP
          +vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",)
          +vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',)
          +vim.foreach_rtp(FailingCall()):NotImplementedError:()
          +vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',)
          +> import
          +import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
          +import failing_import:ImportError:('No module named failing_import',)
          +import failing:ImportError:('No module named failing',)
          > Dictionary
          >> DictionaryConstructor
          vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
          @@ -509,6 +550,7 @@
          d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
          d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:()
          d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:()
          +d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
          d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -535,6 +577,7 @@
          d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',)
          d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:()
          d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:()
          +d["a"] = Mapping({"abcG" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using d["a"] = %s
          d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',)
          @@ -546,12 +589,17 @@
          d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',)
          d["a"] = FailingMapping():NotImplementedError:()
          d["a"] = FailingMappingKey():NotImplementedError:()
          +d["a"] = FailingNumber():TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >> DictionaryUpdate
          >>> kwargs
          >>> iter
          d.update(FailingMapping()):NotImplementedError:()
          d.update([FailingIterNext()]):NotImplementedError:()
          +>>> Testing *Iter* using d.update(%s)
          +d.update(FailingIter()):NotImplementedError:()
          +d.update(FailingIterNext()):NotImplementedError:()
          +<<< Finished
          >>> Testing StringToChars using d.update({%s : 1})
          d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
          d.update({u"\0" : 1}):TypeError:('expected string without null bytes',)
          @@ -577,6 +625,7 @@
          d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
          d.update({"abcF" : FailingMapping()}):NotImplementedError:()
          d.update({"abcF" : FailingMappingKey()}):NotImplementedError:()
          +d.update({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using d.update(Mapping({%s : 1}))
          d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -603,6 +652,7 @@
          d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
          d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
          d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
          +d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using d.update(%s)
          d.update(FailingIter()):NotImplementedError:()
          @@ -614,6 +664,7 @@
          d.update({u"": 1}):ValueError:('empty keys are not allowed',)
          d.update(FailingMapping()):NotImplementedError:()
          d.update(FailingMappingKey()):NotImplementedError:()
          +d.update(FailingNumber()):TypeError:('iteration over non-sequence',)
          <<< Finished
          >>> Testing StringToChars using d.update(((%s, 0),))
          d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -645,6 +696,7 @@
          d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
          d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:()
          d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:()
          +d.update((("a", {"abcF" : FailingNumber()}),)):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
          d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -671,6 +723,7 @@
          d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
          d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:()
          d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:()
          +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using d.update((("a", %s),))
          d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',)
          @@ -682,6 +735,7 @@
          d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',)
          d.update((("a", FailingMapping()),)):NotImplementedError:()
          d.update((("a", FailingMappingKey()),)):NotImplementedError:()
          +d.update((("a", FailingNumber()),)):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >> DictionaryPopItem
          d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',)
          @@ -691,6 +745,10 @@
          >> ListConstructor
          vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',)
          vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',)
          +>>> Testing *Iter* using vim.List(%s)
          +vim.List(FailingIter()):NotImplementedError:()
          +vim.List(FailingIterNext()):NotImplementedError:()
          +<<< Finished
          >>> Testing StringToChars using vim.List([{%s : 1}])
          vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
          vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
          @@ -716,6 +774,7 @@
          vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
          vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:()
          vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
          +vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
          vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -742,6 +801,7 @@
          vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
          vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
          vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
          +vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using vim.List([%s])
          vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
          @@ -753,6 +813,7 @@
          vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',)
          vim.List([FailingMapping()]):NotImplementedError:()
          vim.List([FailingMappingKey()]):NotImplementedError:()
          +vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >> ListItem
          l[1000]:IndexError:('list index out of range',)
          @@ -761,6 +822,10 @@
          l[1000] = 3:IndexError:('list index out of range',)
          >> ListAssSlice
          ll[1:100] = "abcJ":error:('list is locked',)
          +>>> Testing *Iter* using l[:] = %s
          +l[:] = FailingIter():NotImplementedError:()
          +l[:] = FailingIterNext():NotImplementedError:()
          +<<< Finished
          >>> Testing StringToChars using l[:] = [{%s : 1}]
          l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',)
          l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',)
          @@ -786,6 +851,7 @@
          l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
          l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:()
          l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:()
          +l[:] = [{"abcF" : FailingNumber()}]:TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
          l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',)
          @@ -812,6 +878,7 @@
          l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
          l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:()
          l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:()
          +l[:] = [Mapping({"abcG" : FailingNumber()})]:TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using l[:] = [%s]
          l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',)
          @@ -823,8 +890,13 @@
          l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',)
          l[:] = [FailingMapping()]:NotImplementedError:()
          l[:] = [FailingMappingKey()]:NotImplementedError:()
          +l[:] = [FailingNumber()]:TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >> ListConcatInPlace
          +>>> Testing *Iter* using l.extend(%s)
          +l.extend(FailingIter()):NotImplementedError:()
          +l.extend(FailingIterNext()):NotImplementedError:()
          +<<< Finished
          >>> Testing StringToChars using l.extend([{%s : 1}])
          l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
          l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
          @@ -850,6 +922,7 @@
          l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
          l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:()
          l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
          +l.extend([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
          l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -876,6 +949,7 @@
          l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
          l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
          l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
          +l.extend([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using l.extend([%s])
          l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
          @@ -887,6 +961,7 @@
          l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',)
          l.extend([FailingMapping()]):NotImplementedError:()
          l.extend([FailingMappingKey()]):NotImplementedError:()
          +l.extend([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >> ListSetattr
          del l.locked:AttributeError:('cannot delete vim.List attributes',)
          @@ -923,6 +998,7 @@
          f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
          f({"abcF" : FailingMapping()}):NotImplementedError:()
          f({"abcF" : FailingMappingKey()}):NotImplementedError:()
          +f({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using f(Mapping({%s : 1}))
          f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -949,6 +1025,7 @@
          f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
          f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
          f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
          +f(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using f(%s)
          f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',)
          @@ -960,6 +1037,7 @@
          f({u"": 1}):ValueError:('empty keys are not allowed',)
          f(FailingMapping()):NotImplementedError:()
          f(FailingMappingKey()):NotImplementedError:()
          +f(FailingNumber()):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using fd(self={%s : 1})
          fd(self={1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -986,6 +1064,7 @@
          fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
          fd(self={"abcF" : FailingMapping()}):NotImplementedError:()
          fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:()
          +fd(self={"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing StringToChars using fd(self=Mapping({%s : 1}))
          fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
          @@ -1012,6 +1091,7 @@
          fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
          fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
          fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
          +fd(self=Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
          <<< Finished
          >>> Testing *Iter* using fd(self=%s)
          fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',)
          @@ -1023,6 +1103,7 @@
          fd(self={u"": 1}):ValueError:('empty keys are not allowed',)
          fd(self=FailingMapping()):NotImplementedError:()
          fd(self=FailingMappingKey()):NotImplementedError:()
          +fd(self=FailingNumber()):TypeError:('unable to convert FailingNumber to vim dictionary',)
          <<< Finished
          >>> Testing ConvertFromPyMapping using fd(self=%s)
          fd(self=[]):TypeError:('unable to convert object to vim dictionary',)
          @@ -1040,14 +1121,23 @@
          vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',)
          vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',)
          vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',)
          -vim.current.window.height = "abcK":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',)
          -vim.current.window.width = "abcL":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',)
          +>>> Testing NumberToLong using vim.current.window.height = %s
          +vim.current.window.height = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
          +vim.current.window.height = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
          +vim.current.window.height = -1:ValueError:('number must be greater or equal to zero',)
          +<<< Finished
          +>>> Testing NumberToLong using vim.current.window.width = %s
          +vim.current.window.width = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
          +vim.current.window.width = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
          +vim.current.window.width = -1:ValueError:('number must be greater or equal to zero',)
          +<<< Finished
          vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',)
          > WinList
          >> WinListItem
          vim.windows[1000]:IndexError:('no such window',)
          > Buffer
          >> StringToLine (indirect)
          +vim.current.buffer[0] = u"\na":error:('string cannot contain newlines',)
          vim.current.buffer[0] = "\na":error:('string cannot contain newlines',)
          >> SetBufferLine (indirect)
          vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',)
          @@ -1075,8 +1165,13 @@
          vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',)
          > BufMap
          >> BufMapItem
          +vim.buffers[100000000]:KeyError:(100000000,)
          +>>> Testing NumberToLong using vim.buffers[%s]
          +vim.buffers[[]]:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
          vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
          -vim.buffers[100000000]:KeyError:(100000000,)
          +vim.buffers[-1]:ValueError:('number must be greater then zero',)
          +vim.buffers[0]:ValueError:('number must be greater then zero',)
          +<<< Finished
          > Current
          >> CurrentGetattr
          vim.current.xxx:AttributeError:('xxx',)
          @@ -1086,9 +1181,14 @@
          vim.current.window = True:TypeError:('expected vim.Window object, but got bool',)
          vim.current.tabpage = True:TypeError:('expected vim.TabPage object, but got bool',)
          vim.current.xxx = True:AttributeError:('xxx',)
          +['/testdir']
          +'/testdir'
          2,xx
          before
          after
          +pythonx/topmodule/__init__.py
          +pythonx/topmodule/submodule/__init__.py
          +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
          vim.command("throw 'abcN'"):error:('abcN',)
          Exe("throw 'def'"):error:('def',)
          vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/test87.in
          --- a/src/testdir/test87.in Sun Jun 16 22:38:09 2013 +0400
          +++ b/src/testdir/test87.in Mon Jun 17 07:54:07 2013 +0400
          @@ -335,9 +335,9 @@
          EOF
          :py3 sys.settrace(traceit)
          :py3 trace_main()
          +:py3 sys.settrace(None)
          :py3 del traceit
          :py3 del trace_main
          -:py3 sys.settrace(None)
          :$put =string(l)
          :"
          :" Vars
          @@ -898,6 +898,7 @@
          '{"": 1}', # Same, but with unicode object
          'FailingMapping()', #
          'FailingMappingKey()', #
          + 'FailingNumber()', #
          ))

          def convertfrompymapping_test(expr):
          @@ -912,6 +913,15 @@
          'FailingIterNext()',
          ))

          +def number_test(expr, natural=False, unsigned=False):
          + if natural:
          + unsigned = True
          + return subexpr_test(expr, 'NumberToLong', (
          + '[]',
          + 'None',
          + ) + (('-1',) if unsigned else ())
          + + (('0',) if natural else ()))
          +
          class FailingTrue(object):
          def __bool__(self):
          raise NotImplementedError
          @@ -948,10 +958,23 @@
          else:
          return super(FailingList, self).__getitem__(idx)

          +class NoArgsCall(object):
          + def __call__(self):
          + pass
          +
          +class FailingCall(object):
          + def __call__(self, path):
          + raise NotImplementedError
          +
          +class FailingNumber(object):
          + def __int__(self):
          + raise NotImplementedError
          +
          cb.append("> Output")
          cb.append(">> OutputSetattr")
          ee('del sys.stdout.softspace')
          -ee('sys.stdout.softspace = []')
          +number_test('sys.stdout.softspace = %s', unsigned=True)
          +number_test('sys.stderr.softspace = %s', unsigned=True)
          ee('sys.stdout.attr = None')
          cb.append(">> OutputWrite")
          ee('sys.stdout.write(None)')
          @@ -960,18 +983,34 @@
          ee('sys.stdout.writelines([1])')
          iter_test('sys.stdout.writelines(%s)')
          cb.append("> VimCommand")
          -ee('vim.command(1)')
          +stringtochars_test('vim.command(%s)')
          +ee('vim.command("", 2)')
          #! Not checked: vim->python exceptions translating: checked later
          cb.append("> VimToPython")
          #! Not checked: everything: needs errors in internal python functions
          cb.append("> VimEval")
          -ee('vim.eval(1)')
          +stringtochars_test('vim.eval(%s)')
          +ee('vim.eval("", FailingTrue())')
          #! Not checked: everything: needs errors in internal python functions
          cb.append("> VimEvalPy")
          -ee('vim.bindeval(1)')
          +stringtochars_test('vim.bindeval(%s)')
          +ee('vim.eval("", 2)')
          #! Not checked: vim->python exceptions translating: checked later
          cb.append("> VimStrwidth")
          -ee('vim.strwidth(1)')
          +stringtochars_test('vim.strwidth(%s)')
          +cb.append("> VimForeachRTP")
          +ee('vim.foreach_rtp(None)')
          +ee('vim.foreach_rtp(NoArgsCall())')
          +ee('vim.foreach_rtp(FailingCall())')
          +ee('vim.foreach_rtp(int, 2)')
          +cb.append('> import')
          +old_rtp = vim.options['rtp']
          +vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
          +ee('import xxx_no_such_module_xxx')
          +ee('import failing_import')
          +ee('import failing')
          +vim.options['rtp'] = old_rtp
          +del old_rtp
          cb.append("> Dictionary")
          cb.append(">> DictionaryConstructor")
          ee('vim.Dictionary("abcI")')
          @@ -1050,8 +1089,8 @@
          ee('vim.current.window.buffer = 0')
          ee('vim.current.window.cursor = (100000000, 100000000)')
          ee('vim.current.window.cursor = True')
          -ee('vim.current.window.height = "abcK"')
          -ee('vim.current.window.width = "abcL"')
          +number_test('vim.current.window.height = %s', unsigned=True)
          +number_test('vim.current.window.width = %s', unsigned=True)
          ee('vim.current.window.xxxxxx = True')
          cb.append("> WinList")
          cb.append(">> WinListItem")
          @@ -1059,6 +1098,7 @@
          cb.append("> Buffer")
          cb.append(">> StringToLine (indirect)")
          ee('vim.current.buffer[0] = "\\na"')
          +ee('vim.current.buffer[0] = b"\\na"')
          cb.append(">> SetBufferLine (indirect)")
          ee('vim.current.buffer[0] = True')
          cb.append(">> SetBufferLineList (indirect)")
          @@ -1085,8 +1125,8 @@
          ee('vim.current.buffer.range(1, 2, 3)')
          cb.append("> BufMap")
          cb.append(">> BufMapItem")
          -ee('vim.buffers[None]')
          ee('vim.buffers[100000000]')
          +number_test('vim.buffers[%s]', natural=True)
          cb.append("> Current")
          cb.append(">> CurrentGetattr")
          ee('vim.current.xxx')
          @@ -1110,12 +1150,16 @@
          del convertfrompyobject_test
          del convertfrompymapping_test
          del iter_test
          +del number_test
          del FailingTrue
          del FailingIter
          del FailingIterNext
          del FailingMapping
          del FailingMappingKey
          del FailingList
          +del NoArgsCall
          +del FailingCall
          +del FailingNumber
          EOF
          :delfunction F
          :"
          @@ -1124,6 +1168,16 @@
          sys.path.insert(0, os.path.join(os.getcwd(), 'python_before'))
          sys.path.append(os.path.join(os.getcwd(), 'python_after'))
          vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
          +l = []
          +def callback(path):
          + l.append(os.path.relpath(path))
          +vim.foreach_rtp(callback)
          +cb.append(repr(l))
          +del l
          +def callback(path):
          + return os.path.relpath(path)
          +cb.append(repr(vim.foreach_rtp(callback)))
          +del callback
          from module import dir as d
          from modulex import ddir
          cb.append(d + ',' + ddir)
          @@ -1131,10 +1185,19 @@
          cb.append(before.dir)
          import after
          cb.append(after.dir)
          +import topmodule as tm
          +import topmodule.submodule as tms
          +import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss
          +cb.append(tm.__file__[-len('modulex/topmodule/__init__.py'):])
          +cb.append(tms.__file__[-len('modulex/topmodule/submodule/__init__.py'):])
          +cb.append(tmsss.__file__[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):])
          del before
          del after
          del d
          del ddir
          +del tm
          +del tms
          +del tmsss
          EOF
          :"
          :" Test exceptions
          diff -r 4a00cd941a88 -r 42e166b5c6ff src/testdir/test87.ok
          --- a/src/testdir/test87.ok Sun Jun 16 22:38:09 2013 +0400
          +++ b/src/testdir/test87.ok Mon Jun 17 07:54:07 2013 +0400
          @@ -430,7 +430,16 @@
          > Output
          >> OutputSetattr
          del sys.stdout.softspace:(<class 'AttributeError'>, AttributeError("can't delete OutputObject attributes",))
          +>>> Testing NumberToLong using sys.stdout.softspace = %s
          sys.stdout.softspace = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
          +sys.stdout.softspace = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
          +sys.stdout.softspace = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
          +<<< Finished
          +>>> Testing NumberToLong using sys.stderr.softspace = %s
          +sys.stderr.softspace = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
          +sys.stderr.softspace = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
          +sys.stderr.softspace = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
          +<<< Finished
          sys.stdout.attr = None:(<class 'AttributeError'>, AttributeError('invalid attribute: attr',))
          >> OutputWrite
          sys.stdout.write(None):(<class 'TypeError'>, TypeError("Can't convert 'NoneType' object to str implicitly",))
          @@ -442,14 +451,42 @@
          sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          > VimCommand
          +>>> Testing StringToChars using vim.command(%s)
          vim.command(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          +vim.command(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +vim.command("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +<<< Finished
          +vim.command("", 2):(<class 'TypeError'>, TypeError('command() takes exactly one argument (2 given)',))
          > VimToPython
          > VimEval
          +>>> Testing StringToChars using vim.eval(%s)
          vim.eval(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          +vim.eval(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +vim.eval("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +<<< Finished
          +vim.eval("", FailingTrue()):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
          > VimEvalPy
          +>>> Testing StringToChars using vim.bindeval(%s)
          vim.bindeval(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          +vim.bindeval(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +vim.bindeval("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +<<< Finished
          +vim.eval("", 2):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
          > VimStrwidth
          +>>> Testing StringToChars using vim.strwidth(%s)
          vim.strwidth(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          +vim.strwidth(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +vim.strwidth("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
          +<<< Finished
          +> VimForeachRTP
          +vim.foreach_rtp(None):(<class 'TypeError'>, TypeError("'NoneType' object is not callable",))
          +vim.foreach_rtp(NoArgsCall()):(<class 'TypeError'>, TypeError('__call__() takes exactly 1 positional argument (2 given)',))
          +vim.foreach_rtp(FailingCall()):(<class 'NotImplementedError'>, NotImplementedError())
          +vim.foreach_rtp(int, 2):(<class 'TypeError'>, TypeError('foreach_rtp() takes exactly one argument (2 given)',))
          +> import
          +import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
          +import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
          +import failing:(<class 'ImportError'>, ImportError('No module named failing',))
          > Dictionary
          >> DictionaryConstructor
          vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))
          @@ -502,6 +539,7 @@
          d["a"] = {"abcF" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError())
          d["a"] = {"abcF" : FailingMappingKey()}:(<class 'NotImplementedError'>, NotImplementedError())
          +d["a"] = {"abcF" : FailingNumber()}:(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
          d["a"] = Mapping({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -528,6 +566,7 @@
          d["a"] = Mapping({"abcG" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
          d["a"] = Mapping({"abcG" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
          +d["a"] = Mapping({"abcG" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using d["a"] = %s
          d["a"] = FailingIter():(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -539,6 +578,7 @@
          d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError())
          d["a"] = FailingMappingKey():(<class 'NotImplementedError'>, NotImplementedError())
          +d["a"] = FailingNumber():(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >> DictionaryUpdate
          >>> kwargs
          @@ -574,6 +614,7 @@
          d.update({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
          d.update({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using d.update(Mapping({%s : 1}))
          d.update(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -600,6 +641,7 @@
          d.update(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
          d.update(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using d.update(%s)
          d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
          @@ -611,6 +653,7 @@
          d.update({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
          d.update(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update(FailingNumber()):(<class 'TypeError'>, TypeError("'FailingNumber' object is not iterable",))
          <<< Finished
          >>> Testing StringToChars using d.update(((%s, 0),))
          d.update(((1, 0),)):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -642,6 +685,7 @@
          d.update((("a", {"abcF" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError())
          d.update((("a", {"abcF" : FailingMappingKey()}),)):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update((("a", {"abcF" : FailingNumber()}),)):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
          d.update((("a", Mapping({1 : 1})),)):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -668,6 +712,7 @@
          d.update((("a", Mapping({"abcG" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError())
          d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using d.update((("a", %s),))
          d.update((("a", FailingIter()),)):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -679,6 +724,7 @@
          d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError())
          d.update((("a", FailingMappingKey()),)):(<class 'NotImplementedError'>, NotImplementedError())
          +d.update((("a", FailingNumber()),)):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >> DictionaryPopItem
          d.popitem(1, 2):(<class 'TypeError'>, TypeError('popitem() takes no arguments (2 given)',))
          @@ -717,6 +763,7 @@
          vim.List([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
          vim.List([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
          +vim.List([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
          vim.List([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -743,6 +790,7 @@
          vim.List([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
          vim.List([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
          +vim.List([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using vim.List([%s])
          vim.List([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -754,6 +802,7 @@
          vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
          vim.List([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
          +vim.List([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >> ListItem
          l[1000]:(<class 'IndexError'>, IndexError('list index out of range',))
          @@ -791,6 +840,7 @@
          l[:] = [{"abcF" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError())
          l[:] = [{"abcF" : FailingMappingKey()}]:(<class 'NotImplementedError'>, NotImplementedError())
          +l[:] = [{"abcF" : FailingNumber()}]:(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
          l[:] = [Mapping({1 : 1})]:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -817,6 +867,7 @@
          l[:] = [Mapping({"abcG" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError())
          l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(<class 'NotImplementedError'>, NotImplementedError())
          +l[:] = [Mapping({"abcG" : FailingNumber()})]:(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using l[:] = [%s]
          l[:] = [FailingIter()]:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -828,6 +879,7 @@
          l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError())
          l[:] = [FailingMappingKey()]:(<class 'NotImplementedError'>, NotImplementedError())
          +l[:] = [FailingNumber()]:(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >> ListConcatInPlace
          >>> Testing *Iter* using l.extend(%s)
          @@ -859,6 +911,7 @@
          l.extend([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l.extend([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
          l.extend([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
          +l.extend([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
          l.extend([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -885,6 +938,7 @@
          l.extend([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l.extend([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
          l.extend([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
          +l.extend([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using l.extend([%s])
          l.extend([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -896,6 +950,7 @@
          l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          l.extend([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
          l.extend([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
          +l.extend([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >> ListSetattr
          del l.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.List attributes',))
          @@ -932,6 +987,7 @@
          f({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          f({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
          f({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
          +f({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using f(Mapping({%s : 1}))
          f(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -958,6 +1014,7 @@
          f(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          f(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
          f(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
          +f(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using f(%s)
          f(FailingIter()):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
          @@ -969,6 +1026,7 @@
          f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
          f(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
          +f(FailingNumber()):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using fd(self={%s : 1})
          fd(self={1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -995,6 +1053,7 @@
          fd(self={"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          fd(self={"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
          fd(self={"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
          +fd(self={"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing StringToChars using fd(self=Mapping({%s : 1}))
          fd(self=Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
          @@ -1021,6 +1080,7 @@
          fd(self=Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          fd(self=Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
          fd(self=Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
          +fd(self=Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
          <<< Finished
          >>> Testing *Iter* using fd(self=%s)
          fd(self=FailingIter()):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim dictionary',))
          @@ -1032,6 +1092,7 @@
          fd(self={"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
          fd(self=FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
          fd(self=FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
          +fd(self=FailingNumber()):(<class 'TypeError'>, TypeError('unable to convert FailingNumber to vim dictionary',))
          <<< Finished
          >>> Testing ConvertFromPyMapping using fd(self=%s)
          fd(self=[]):(<class 'AttributeError'>, AttributeError('keys',))
          @@ -1049,8 +1110,16 @@
          vim.current.window.buffer = 0:(<class 'TypeError'>, TypeError('readonly attribute: buffer',))
          vim.current.window.cursor = (100000000, 100000000):(<class 'vim.error'>, error('cursor position outside buffer',))
          vim.current.window.cursor = True:(<class 'TypeError'>, TypeError('argument must be 2-item sequence, not bool',))
          -vim.current.window.height = "abcK":(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got str',))
          -vim.current.window.width = "abcL":(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got str',))
          +>>> Testing NumberToLong using vim.current.window.height = %s
          +vim.current.window.height = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
          +vim.current.window.height = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
          +vim.current.window.height = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
          +<<< Finished
          +>>> Testing NumberToLong using vim.current.window.width = %s
          +vim.current.window.width = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
          +vim.current.window.width = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
          +vim.current.window.width = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
          +<<< Finished
          vim.current.window.xxxxxx = True:(<class 'AttributeError'>, AttributeError('xxxxxx',))
          > WinList
          >> WinListItem
          @@ -1058,6 +1127,7 @@
          > Buffer
          >> StringToLine (indirect)
          vim.current.buffer[0] = "\na":(<class 'vim.error'>, error('string cannot contain newlines',))
          +vim.current.buffer[0] = b"\na":(<class 'vim.error'>, error('string cannot contain newlines',))
          >> SetBufferLine (indirect)
          vim.current.buffer[0] = True:(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
          >> SetBufferLineList (indirect)
          @@ -1084,8 +1154,13 @@
          vim.current.buffer.range(1, 2, 3):(<class 'TypeError'>, TypeError('function takes exactly 2 arguments (3 given)',))
          > BufMap
          >> BufMapItem
          +vim.buffers[100000000]:(<class 'KeyError'>, KeyError(100000000,))
          +>>> Testing NumberToLong using vim.buffers[%s]
          +vim.buffers[[]]:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
          vim.buffers[None]:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
          -vim.buffers[100000000]:(<class 'KeyError'>, KeyError(100000000,))
          +vim.buffers[-1]:(<class 'ValueError'>, ValueError('number must be greater then zero',))
          +vim.buffers[0]:(<class 'ValueError'>, ValueError('number must be greater then zero',))
          +<<< Finished
          > Current
          >> CurrentGetattr
          vim.current.xxx:(<class 'AttributeError'>, AttributeError("'vim.currentdata' object has no attribute 'xxx'",))
          @@ -1095,9 +1170,14 @@
          vim.current.window = True:(<class 'TypeError'>, TypeError('expected vim.Window object, but got bool',))
          vim.current.tabpage = True:(<class 'TypeError'>, TypeError('expected vim.TabPage object, but got bool',))
          vim.current.xxx = True:(<class 'AttributeError'>, AttributeError('xxx',))
          +['.']
          +'.'
          3,xx
          before
          after
          +pythonx/topmodule/__init__.py
          +pythonx/topmodule/submodule/__init__.py
          +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
          vim.command("throw 'abcN'"):(<class 'vim.error'>, error('abcN',))
          Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
          vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • ZyX
          “XXX undetected error” fix is the change described in the previous message. # HG changeset patch # User ZyX # Date 1371669021 -14400 #
          Message 4 of 25 , Jun 19, 2013
          • 0 Attachment
            “XXX undetected error” fix is the change described in the previous message.

            # HG changeset patch
            # User ZyX <kp-pav@...>
            # Date 1371669021 -14400
            # Wed Jun 19 23:10:21 2013 +0400
            # Branch python-fixes
            # Node ID 38acdea8fd7d2179916c4e67bdc8e54941929093
            # Parent 42e166b5c6ff07cd7810780b1d3704b8ce61bac0
            Some fixes:

            - Remove object_adder and attribute_getter populate_module arguments as they are
            now the same for both pythons.
            - Type cast PySequence_Fast_GET_SIZE
            - Make tests also work on python-2.7
            - Fix “XXX undetected error” problem (`if (PyErr_Occurred)` part).
            - Fix “negative refcount” crash (`Py_DECREF(rObj)` part)
            - Mark NotImplementedError’s in tests, also solve absence of sys problem in
            test86

            diff -r 42e166b5c6ff -r 38acdea8fd7d src/if_py_both.h
            --- a/src/if_py_both.h Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/if_py_both.h Wed Jun 19 23:10:21 2013 +0400
            @@ -1610,7 +1610,7 @@

            ret = (rObj == Py_True);

            - Py_DECREF(Py_True);
            + Py_DECREF(rObj);

            return ret;
            }
            @@ -1909,7 +1909,7 @@
            PyErr_FORMAT(PyExc_ValueError,
            "expected sequence element of size 2, "
            "but got sequence of size %d",
            - PySequence_Fast_GET_SIZE(fast));
            + (int) PySequence_Fast_GET_SIZE(fast));
            return NULL;
            }

            @@ -2433,6 +2433,10 @@
            clear_tv(&v);
            }
            Py_DECREF(iterator);
            +
            + if (PyErr_Occurred())
            + return -1;
            +
            return 0;
            }

            @@ -3514,7 +3518,7 @@
            char *str;
            char *save;
            PyObject *bytes = NULL;
            - Py_ssize_t len;
            + Py_ssize_t len = 0;
            PyInt i;
            char *p;

            @@ -5479,6 +5483,7 @@
            #endif
            else if (PyObject_HasAttrString(obj, "keys"))
            return convert_dl(obj, tv, pymap_to_tv, lookup_dict);
            + /* PyObject_GetIter can create built-in iterator for any sequence object */
            else if (PyIter_Check(obj) || PySequence_Check(obj))
            return convert_dl(obj, tv, pyseq_to_tv, lookup_dict);
            else if (PyMapping_Check(obj))
            @@ -5926,11 +5931,8 @@
            {"_Loader", (PyObject *)&LoaderType},
            };

            -typedef int (*object_adder)(PyObject *, const char *, PyObject *);
            -typedef PyObject *(*attr_getter)(PyObject *, const char *);
            -
            #define ADD_OBJECT(m, name, obj) \
            - if (add_object(m, name, obj)) \
            + if (PyModule_AddObject(m, name, obj)) \
            return -1;

            #define ADD_CHECKED_OBJECT(m, name, obj) \
            @@ -5942,7 +5944,7 @@
            }

            static int
            -populate_module(PyObject *m, object_adder add_object, attr_getter get_attr)
            +populate_module(PyObject *m)
            {
            int i;
            PyObject *other_module;
            @@ -5986,7 +5988,7 @@
            if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir")))
            return -1;
            ADD_OBJECT(m, "_chdir", py_chdir);
            - if (!(attr = get_attr(m, "chdir")))
            + if (!(attr = PyObject_GetAttrString(m, "chdir")))
            return -1;
            if (PyObject_SetAttrString(other_module, "chdir", attr))
            {
            @@ -5998,7 +6000,7 @@
            if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir")))
            {
            ADD_OBJECT(m, "_fchdir", py_fchdir);
            - if (!(attr = get_attr(m, "fchdir")))
            + if (!(attr = PyObject_GetAttrString(m, "fchdir")))
            return -1;
            if (PyObject_SetAttrString(other_module, "fchdir", attr))
            {
            diff -r 42e166b5c6ff -r 38acdea8fd7d src/if_python.c
            --- a/src/if_python.c Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/if_python.c Wed Jun 19 23:10:21 2013 +0400
            @@ -1404,8 +1404,7 @@
            vim_module = Py_InitModule4("vim", VimMethods, (char *)NULL,
            (PyObject *)NULL, PYTHON_API_VERSION);

            - if (populate_module(vim_module, PyModule_AddObject,
            - PyObject_GetAttrString))
            + if (populate_module(vim_module))
            return -1;

            if (init_sys_path())
            diff -r 42e166b5c6ff -r 38acdea8fd7d src/if_python3.c
            --- a/src/if_python3.c Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/if_python3.c Wed Jun 19 23:10:21 2013 +0400
            @@ -1623,7 +1623,7 @@
            if ((vim_module = PyModule_Create(&vimmodule)) == NULL)
            return NULL;

            - if (populate_module(vim_module, PyModule_AddObject, PyObject_GetAttrString))
            + if (populate_module(vim_module))
            return NULL;

            if (init_sys_path())
            diff -r 42e166b5c6ff -r 38acdea8fd7d src/testdir/test86.in
            --- a/src/testdir/test86.in Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/testdir/test86.in Wed Jun 19 23:10:21 2013 +0400
            @@ -216,6 +216,7 @@
            :let messages=[]
            :delfunction DictNew
            py <<EOF
            +import sys
            d=vim.bindeval('{}')
            m=vim.bindeval('messages')
            def em(expr, g=globals(), l=locals()):
            @@ -297,7 +298,7 @@
            :" threading
            :let l = [0]
            :py l=vim.bindeval('l')
            -:py <<EOF
            +py <<EOF
            import threading
            import time

            @@ -327,7 +328,7 @@
            :" settrace
            :let l = []
            :py l=vim.bindeval('l')
            -:py <<EOF
            +py <<EOF
            import sys

            def traceit(frame, event, arg):
            @@ -880,10 +881,16 @@
            if expr.find('None') > -1:
            msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
            'TypeError:("\'NoneType\' object is not iterable",)')
            + if expr.find('FailingNumber') > -1:
            + msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'')
            + msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
            + 'TypeError:("\'FailingNumber\' object is not iterable",)')
            + if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
            + msg = msg.replace('(\'', '("').replace('\',)', '",)')
            if expr == 'fd(self=[])':
            # HACK: PyMapping_Check changed meaning
            msg = msg.replace('AttributeError:(\'keys\',)',
            - 'TypeError:(\'unable to convert object to vim dictionary\',)')
            + 'TypeError:(\'unable to convert list to vim dictionary\',)')
            cb.append(expr + ':' + msg)
            else:
            cb.append(expr + ':NOT FAILED')
            @@ -968,37 +975,37 @@

            class FailingTrue(object):
            def __nonzero__(self):
            - raise NotImplementedError
            + raise NotImplementedError('bool')

            class FailingIter(object):
            def __iter__(self):
            - raise NotImplementedError
            + raise NotImplementedError('iter')

            class FailingIterNext(object):
            def __iter__(self):
            return self

            def next(self):
            - raise NotImplementedError
            + raise NotImplementedError('next')

            class FailingMappingKey(object):
            def __getitem__(self, item):
            - raise NotImplementedError
            + raise NotImplementedError('getitem:mappingkey')

            def keys(self):
            return list("abcH")

            class FailingMapping(object):
            def __getitem__(self):
            - raise NotImplementedError
            + raise NotImplementedError('getitem:mapping')

            def keys(self):
            - raise NotImplementedError
            + raise NotImplementedError('keys')

            class FailingList(list):
            def __getitem__(self, idx):
            if i == 2:
            - raise NotImplementedError
            + raise NotImplementedError('getitem:list')
            else:
            return super(FailingList, self).__getitem__(idx)

            @@ -1008,11 +1015,11 @@

            class FailingCall(object):
            def __call__(self, path):
            - raise NotImplementedError
            + raise NotImplementedError('call')

            class FailingNumber(object):
            def __int__(self):
            - raise NotImplementedError
            + raise NotImplementedError('int')

            cb.append("> Output")
            cb.append(">> OutputSetattr")
            @@ -1295,6 +1302,7 @@
            :call garbagecollect(1)
            :"
            :/^start:/,$wq! test.out
            +:" vim: et ts=4 isk-=\:
            :call getchar()
            ENDTEST

            diff -r 42e166b5c6ff -r 38acdea8fd7d src/testdir/test86.ok
            --- a/src/testdir/test86.ok Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/testdir/test86.ok Wed Jun 19 23:10:21 2013 +0400
            @@ -458,8 +458,8 @@
            sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",)
            sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',)
            >>> Testing *Iter* using sys.stdout.writelines(%s)
            -sys.stdout.writelines(FailingIter()):NotImplementedError:()
            -sys.stdout.writelines(FailingIterNext()):NotImplementedError:()
            +sys.stdout.writelines(FailingIter()):NotImplementedError:('iter',)
            +sys.stdout.writelines(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            > VimCommand
            >>> Testing StringToChars using vim.command(%s)
            @@ -492,7 +492,7 @@
            > VimForeachRTP
            vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",)
            vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',)
            -vim.foreach_rtp(FailingCall()):NotImplementedError:()
            +vim.foreach_rtp(FailingCall()):NotImplementedError:('call',)
            vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',)
            > import
            import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
            @@ -503,7 +503,7 @@
            vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
            >> DictionarySetattr
            del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',)
            -d.locked = FailingTrue():NotImplementedError:()
            +d.locked = FailingTrue():NotImplementedError:('bool',)
            vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',)
            d.scope = True:AttributeError:('cannot set attribute scope',)
            d.xxx = True:AttributeError:('cannot set attribute xxx',)
            @@ -542,14 +542,14 @@
            <<< Finished
            >>> Testing *Iter* using d["a"] = {"abcF" : %s}
            d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',)
            -d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:()
            +d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s}
            d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',)
            d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',)
            d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
            -d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:()
            -d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:()
            +d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:('keys',)
            +d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:('getitem:mappingkey',)
            d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
            @@ -569,36 +569,36 @@
            <<< Finished
            >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s})
            d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
            -d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:()
            +d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s})
            d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',)
            d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',)
            d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',)
            -d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:()
            -d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:()
            +d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:('keys',)
            +d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',)
            d["a"] = Mapping({"abcG" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using d["a"] = %s
            d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',)
            -d["a"] = FailingIterNext():NotImplementedError:()
            +d["a"] = FailingIterNext():NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = %s
            d["a"] = None:TypeError:('unable to convert NoneType to vim structure',)
            d["a"] = {"": 1}:ValueError:('empty keys are not allowed',)
            d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',)
            -d["a"] = FailingMapping():NotImplementedError:()
            -d["a"] = FailingMappingKey():NotImplementedError:()
            +d["a"] = FailingMapping():NotImplementedError:('keys',)
            +d["a"] = FailingMappingKey():NotImplementedError:('getitem:mappingkey',)
            d["a"] = FailingNumber():TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >> DictionaryUpdate
            >>> kwargs
            >>> iter
            -d.update(FailingMapping()):NotImplementedError:()
            -d.update([FailingIterNext()]):NotImplementedError:()
            +d.update(FailingMapping()):NotImplementedError:('keys',)
            +d.update([FailingIterNext()]):NotImplementedError:('next',)
            >>> Testing *Iter* using d.update(%s)
            -d.update(FailingIter()):NotImplementedError:()
            -d.update(FailingIterNext()):NotImplementedError:()
            +d.update(FailingIter()):NotImplementedError:('iter',)
            +d.update(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            >>> Testing StringToChars using d.update({%s : 1})
            d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
            @@ -617,14 +617,14 @@
            <<< Finished
            >>> Testing *Iter* using d.update({"abcF" : %s})
            d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
            -d.update({"abcF" : FailingIterNext()}):NotImplementedError:()
            +d.update({"abcF" : FailingIterNext()}):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update({"abcF" : %s})
            d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
            d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
            d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
            -d.update({"abcF" : FailingMapping()}):NotImplementedError:()
            -d.update({"abcF" : FailingMappingKey()}):NotImplementedError:()
            +d.update({"abcF" : FailingMapping()}):NotImplementedError:('keys',)
            +d.update({"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',)
            d.update({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using d.update(Mapping({%s : 1}))
            @@ -644,27 +644,27 @@
            <<< Finished
            >>> Testing *Iter* using d.update(Mapping({"abcG" : %s}))
            d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
            -d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:()
            +d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s}))
            d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
            d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
            d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
            -d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
            -d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
            +d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
            +d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',)
            d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using d.update(%s)
            -d.update(FailingIter()):NotImplementedError:()
            -d.update(FailingIterNext()):NotImplementedError:()
            +d.update(FailingIter()):NotImplementedError:('iter',)
            +d.update(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update(%s)
            d.update(None):TypeError:("'NoneType' object is not iterable",)
            d.update({"": 1}):ValueError:('empty keys are not allowed',)
            d.update({u"": 1}):ValueError:('empty keys are not allowed',)
            -d.update(FailingMapping()):NotImplementedError:()
            -d.update(FailingMappingKey()):NotImplementedError:()
            -d.update(FailingNumber()):TypeError:('iteration over non-sequence',)
            +d.update(FailingMapping()):NotImplementedError:('keys',)
            +d.update(FailingMappingKey()):NotImplementedError:('getitem:mappingkey',)
            +d.update(FailingNumber()):TypeError:("'FailingNumber' object is not iterable",)
            <<< Finished
            >>> Testing StringToChars using d.update(((%s, 0),))
            d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',)
            @@ -688,14 +688,14 @@
            <<< Finished
            >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),))
            d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',)
            -d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:()
            +d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),))
            d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',)
            d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',)
            d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
            -d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:()
            -d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:()
            +d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:('keys',)
            +d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:('getitem:mappingkey',)
            d.update((("a", {"abcF" : FailingNumber()}),)):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
            @@ -715,26 +715,26 @@
            <<< Finished
            >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),))
            d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',)
            -d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:()
            +d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),))
            d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',)
            d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',)
            d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
            -d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:()
            -d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:()
            +d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:('keys',)
            +d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:('getitem:mappingkey',)
            d.update((("a", Mapping({"abcG" : FailingNumber()})),)):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using d.update((("a", %s),))
            d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',)
            -d.update((("a", FailingIterNext()),)):NotImplementedError:()
            +d.update((("a", FailingIterNext()),)):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", %s),))
            d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',)
            d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',)
            d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',)
            -d.update((("a", FailingMapping()),)):NotImplementedError:()
            -d.update((("a", FailingMappingKey()),)):NotImplementedError:()
            +d.update((("a", FailingMapping()),)):NotImplementedError:('keys',)
            +d.update((("a", FailingMappingKey()),)):NotImplementedError:('getitem:mappingkey',)
            d.update((("a", FailingNumber()),)):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >> DictionaryPopItem
            @@ -746,8 +746,8 @@
            vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',)
            vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',)
            >>> Testing *Iter* using vim.List(%s)
            -vim.List(FailingIter()):NotImplementedError:()
            -vim.List(FailingIterNext()):NotImplementedError:()
            +vim.List(FailingIter()):NotImplementedError:('iter',)
            +vim.List(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            >>> Testing StringToChars using vim.List([{%s : 1}])
            vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
            @@ -766,14 +766,14 @@
            <<< Finished
            >>> Testing *Iter* using vim.List([{"abcF" : %s}])
            vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
            -vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:()
            +vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
            vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
            vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
            vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
            -vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:()
            -vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
            +vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',)
            +vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',)
            vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
            @@ -793,26 +793,26 @@
            <<< Finished
            >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})])
            vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
            -vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:()
            +vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
            vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
            vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
            vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
            -vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
            -vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
            +vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',)
            +vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',)
            vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using vim.List([%s])
            vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
            -vim.List([FailingIterNext()]):NotImplementedError:()
            +vim.List([FailingIterNext()]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([%s])
            vim.List([None]):TypeError:('unable to convert NoneType to vim structure',)
            vim.List([{"": 1}]):ValueError:('empty keys are not allowed',)
            vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',)
            -vim.List([FailingMapping()]):NotImplementedError:()
            -vim.List([FailingMappingKey()]):NotImplementedError:()
            +vim.List([FailingMapping()]):NotImplementedError:('keys',)
            +vim.List([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',)
            vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >> ListItem
            @@ -823,8 +823,8 @@
            >> ListAssSlice
            ll[1:100] = "abcJ":error:('list is locked',)
            >>> Testing *Iter* using l[:] = %s
            -l[:] = FailingIter():NotImplementedError:()
            -l[:] = FailingIterNext():NotImplementedError:()
            +l[:] = FailingIter():NotImplementedError:('iter',)
            +l[:] = FailingIterNext():NotImplementedError:('next',)
            <<< Finished
            >>> Testing StringToChars using l[:] = [{%s : 1}]
            l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',)
            @@ -843,14 +843,14 @@
            <<< Finished
            >>> Testing *Iter* using l[:] = [{"abcF" : %s}]
            l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',)
            -l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:()
            +l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}]
            l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',)
            l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',)
            l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
            -l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:()
            -l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:()
            +l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:('keys',)
            +l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:('getitem:mappingkey',)
            l[:] = [{"abcF" : FailingNumber()}]:TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
            @@ -870,32 +870,32 @@
            <<< Finished
            >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})]
            l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',)
            -l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:()
            +l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})]
            l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',)
            l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',)
            l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
            -l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:()
            -l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:()
            +l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:('keys',)
            +l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:('getitem:mappingkey',)
            l[:] = [Mapping({"abcG" : FailingNumber()})]:TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using l[:] = [%s]
            l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',)
            -l[:] = [FailingIterNext()]:NotImplementedError:()
            +l[:] = [FailingIterNext()]:NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [%s]
            l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',)
            l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',)
            l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',)
            -l[:] = [FailingMapping()]:NotImplementedError:()
            -l[:] = [FailingMappingKey()]:NotImplementedError:()
            +l[:] = [FailingMapping()]:NotImplementedError:('keys',)
            +l[:] = [FailingMappingKey()]:NotImplementedError:('getitem:mappingkey',)
            l[:] = [FailingNumber()]:TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >> ListConcatInPlace
            >>> Testing *Iter* using l.extend(%s)
            -l.extend(FailingIter()):NotImplementedError:()
            -l.extend(FailingIterNext()):NotImplementedError:()
            +l.extend(FailingIter()):NotImplementedError:('iter',)
            +l.extend(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            >>> Testing StringToChars using l.extend([{%s : 1}])
            l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
            @@ -914,14 +914,14 @@
            <<< Finished
            >>> Testing *Iter* using l.extend([{"abcF" : %s}])
            l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',)
            -l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:()
            +l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}])
            l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
            l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
            l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
            -l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:()
            -l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
            +l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',)
            +l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',)
            l.extend([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
            @@ -941,31 +941,31 @@
            <<< Finished
            >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})])
            l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',)
            -l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:()
            +l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})])
            l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
            l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
            l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
            -l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
            -l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
            +l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',)
            +l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',)
            l.extend([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using l.extend([%s])
            l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
            -l.extend([FailingIterNext()]):NotImplementedError:()
            +l.extend([FailingIterNext()]):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using l.extend([%s])
            l.extend([None]):TypeError:('unable to convert NoneType to vim structure',)
            l.extend([{"": 1}]):ValueError:('empty keys are not allowed',)
            l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',)
            -l.extend([FailingMapping()]):NotImplementedError:()
            -l.extend([FailingMappingKey()]):NotImplementedError:()
            +l.extend([FailingMapping()]):NotImplementedError:('keys',)
            +l.extend([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',)
            l.extend([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >> ListSetattr
            del l.locked:AttributeError:('cannot delete vim.List attributes',)
            -l.locked = FailingTrue():NotImplementedError:()
            +l.locked = FailingTrue():NotImplementedError:('bool',)
            l.xxx = True:AttributeError:('cannot set attribute xxx',)
            > Function
            >> FunctionConstructor
            @@ -990,14 +990,14 @@
            <<< Finished
            >>> Testing *Iter* using f({"abcF" : %s})
            f({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
            -f({"abcF" : FailingIterNext()}):NotImplementedError:()
            +f({"abcF" : FailingIterNext()}):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using f({"abcF" : %s})
            f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
            f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
            f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
            -f({"abcF" : FailingMapping()}):NotImplementedError:()
            -f({"abcF" : FailingMappingKey()}):NotImplementedError:()
            +f({"abcF" : FailingMapping()}):NotImplementedError:('keys',)
            +f({"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',)
            f({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using f(Mapping({%s : 1}))
            @@ -1017,26 +1017,26 @@
            <<< Finished
            >>> Testing *Iter* using f(Mapping({"abcG" : %s}))
            f(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
            -f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:()
            +f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s}))
            f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
            f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
            f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
            -f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
            -f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
            +f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
            +f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',)
            f(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using f(%s)
            f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',)
            -f(FailingIterNext()):NotImplementedError:()
            +f(FailingIterNext()):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using f(%s)
            f(None):TypeError:('unable to convert NoneType to vim structure',)
            f({"": 1}):ValueError:('empty keys are not allowed',)
            f({u"": 1}):ValueError:('empty keys are not allowed',)
            -f(FailingMapping()):NotImplementedError:()
            -f(FailingMappingKey()):NotImplementedError:()
            +f(FailingMapping()):NotImplementedError:('keys',)
            +f(FailingMappingKey()):NotImplementedError:('getitem:mappingkey',)
            f(FailingNumber()):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using fd(self={%s : 1})
            @@ -1056,14 +1056,14 @@
            <<< Finished
            >>> Testing *Iter* using fd(self={"abcF" : %s})
            fd(self={"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',)
            -fd(self={"abcF" : FailingIterNext()}):NotImplementedError:()
            +fd(self={"abcF" : FailingIterNext()}):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s})
            fd(self={"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
            fd(self={"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
            fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
            -fd(self={"abcF" : FailingMapping()}):NotImplementedError:()
            -fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:()
            +fd(self={"abcF" : FailingMapping()}):NotImplementedError:('keys',)
            +fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',)
            fd(self={"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing StringToChars using fd(self=Mapping({%s : 1}))
            @@ -1083,14 +1083,14 @@
            <<< Finished
            >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s}))
            fd(self=Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',)
            -fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:()
            +fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
            <<< Finished
            >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s}))
            fd(self=Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
            fd(self=Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
            fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
            -fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
            -fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
            +fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
            +fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',)
            fd(self=Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
            <<< Finished
            >>> Testing *Iter* using fd(self=%s)
            @@ -1101,12 +1101,12 @@
            fd(self=None):TypeError:('unable to convert NoneType to vim dictionary',)
            fd(self={"": 1}):ValueError:('empty keys are not allowed',)
            fd(self={u"": 1}):ValueError:('empty keys are not allowed',)
            -fd(self=FailingMapping()):NotImplementedError:()
            -fd(self=FailingMappingKey()):NotImplementedError:()
            +fd(self=FailingMapping()):NotImplementedError:('keys',)
            +fd(self=FailingMappingKey()):NotImplementedError:('getitem:mappingkey',)
            fd(self=FailingNumber()):TypeError:('unable to convert FailingNumber to vim dictionary',)
            <<< Finished
            >>> Testing ConvertFromPyMapping using fd(self=%s)
            -fd(self=[]):TypeError:('unable to convert object to vim dictionary',)
            +fd(self=[]):TypeError:('unable to convert list to vim dictionary',)
            <<< Finished
            > TabPage
            >> TabPageAttr
            diff -r 42e166b5c6ff -r 38acdea8fd7d src/testdir/test87.in
            --- a/src/testdir/test87.in Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/testdir/test87.in Wed Jun 19 23:10:21 2013 +0400
            @@ -290,7 +290,7 @@
            :" threading
            :let l = [0]
            :py3 l=vim.bindeval('l')
            -:py3 <<EOF
            +py3 <<EOF
            import threading
            import time

            @@ -320,7 +320,7 @@
            :" settrace
            :let l = []
            :py3 l=vim.bindeval('l')
            -:py3 <<EOF
            +py3 <<EOF
            import sys

            def traceit(frame, event, arg):
            @@ -924,37 +924,37 @@

            class FailingTrue(object):
            def __bool__(self):
            - raise NotImplementedError
            + raise NotImplementedError('bool')

            class FailingIter(object):
            def __iter__(self):
            - raise NotImplementedError
            + raise NotImplementedError('iter')

            class FailingIterNext(object):
            def __iter__(self):
            return self

            def __next__(self):
            - raise NotImplementedError
            + raise NotImplementedError('next')

            class FailingMappingKey(object):
            def __getitem__(self, item):
            - raise NotImplementedError
            + raise NotImplementedError('getitem:mappingkey')

            def keys(self):
            return list("abcH")

            class FailingMapping(object):
            def __getitem__(self):
            - raise NotImplementedError
            + raise NotImplementedError('getitem:mapping')

            def keys(self):
            - raise NotImplementedError
            + raise NotImplementedError('keys')

            class FailingList(list):
            def __getitem__(self, idx):
            if i == 2:
            - raise NotImplementedError
            + raise NotImplementedError('getitem:list')
            else:
            return super(FailingList, self).__getitem__(idx)

            @@ -964,11 +964,11 @@

            class FailingCall(object):
            def __call__(self, path):
            - raise NotImplementedError
            + raise NotImplementedError('call')

            class FailingNumber(object):
            def __int__(self):
            - raise NotImplementedError
            + raise NotImplementedError('int')

            cb.append("> Output")
            cb.append(">> OutputSetattr")
            @@ -1251,6 +1251,7 @@
            :call garbagecollect(1)
            :"
            :/^start:/,$wq! test.out
            +:" vim: et ts=4 isk-=\:
            :call getchar()
            ENDTEST

            diff -r 42e166b5c6ff -r 38acdea8fd7d src/testdir/test87.ok
            --- a/src/testdir/test87.ok Mon Jun 17 07:54:07 2013 +0400
            +++ b/src/testdir/test87.ok Wed Jun 19 23:10:21 2013 +0400
            @@ -447,8 +447,8 @@
            sys.stdout.writelines(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
            sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError("Can't convert 'int' object to str implicitly",))
            >>> Testing *Iter* using sys.stdout.writelines(%s)
            -sys.stdout.writelines(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
            -sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
            +sys.stdout.writelines(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError('iter',))
            +sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            > VimCommand
            >>> Testing StringToChars using vim.command(%s)
            @@ -481,7 +481,7 @@
            > VimForeachRTP
            vim.foreach_rtp(None):(<class 'TypeError'>, TypeError("'NoneType' object is not callable",))
            vim.foreach_rtp(NoArgsCall()):(<class 'TypeError'>, TypeError('__call__() takes exactly 1 positional argument (2 given)',))
            -vim.foreach_rtp(FailingCall()):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.foreach_rtp(FailingCall()):(<class 'NotImplementedError'>, NotImplementedError('call',))
            vim.foreach_rtp(int, 2):(<class 'TypeError'>, TypeError('foreach_rtp() takes exactly one argument (2 given)',))
            > import
            import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
            @@ -492,7 +492,7 @@
            vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))
            >> DictionarySetattr
            del d.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.Dictionary attributes',))
            -d.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError())
            +d.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError('bool',))
            vim.vvars.locked = False:(<class 'TypeError'>, TypeError('cannot modify fixed dictionary',))
            d.scope = True:(<class 'AttributeError'>, AttributeError('cannot set attribute scope',))
            d.xxx = True:(<class 'AttributeError'>, AttributeError('cannot set attribute xxx',))
            @@ -531,15 +531,15 @@
            <<< Finished
            >>> Testing *Iter* using d["a"] = {"abcF" : %s}
            d["a"] = {"abcF" : FailingIter()}:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d["a"] = {"abcF" : FailingIterNext()}:(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = {"abcF" : FailingIterNext()}:(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s}
            d["a"] = {"abcF" : None}:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d["a"] = {"abcF" : {b"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d["a"] = {"abcF" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = {"abcF" : FailingMappingKey()}:(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = {"abcF" : FailingNumber()}:(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d["a"] = {"abcF" : FailingMappingKey()}:(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d["a"] = {"abcF" : FailingNumber()}:(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
            d["a"] = Mapping({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -558,36 +558,36 @@
            <<< Finished
            >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s})
            d["a"] = Mapping({"abcG" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d["a"] = Mapping({"abcG" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = Mapping({"abcG" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s})
            d["a"] = Mapping({"abcG" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d["a"] = Mapping({"abcG" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d["a"] = Mapping({"abcG" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = Mapping({"abcG" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = Mapping({"abcG" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d["a"] = Mapping({"abcG" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d["a"] = Mapping({"abcG" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing *Iter* using d["a"] = %s
            d["a"] = FailingIter():(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d["a"] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d["a"] = %s
            d["a"] = None:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d["a"] = {b"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = FailingMappingKey():(<class 'NotImplementedError'>, NotImplementedError())
            -d["a"] = FailingNumber():(<class 'NotImplementedError'>, NotImplementedError())
            +d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d["a"] = FailingMappingKey():(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d["a"] = FailingNumber():(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >> DictionaryUpdate
            >>> kwargs
            >>> iter
            -d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',))
            >>> Testing *Iter* using d.update(%s)
            -d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError('iter',))
            +d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing StringToChars using d.update({%s : 1})
            d.update({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -606,15 +606,15 @@
            <<< Finished
            >>> Testing *Iter* using d.update({"abcF" : %s})
            d.update({"abcF" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d.update({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update({"abcF" : %s})
            d.update({"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d.update({"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d.update({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing StringToChars using d.update(Mapping({%s : 1}))
            d.update(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -633,26 +633,26 @@
            <<< Finished
            >>> Testing *Iter* using d.update(Mapping({"abcG" : %s}))
            d.update(Mapping({"abcG" : FailingIter()})):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d.update(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s}))
            d.update(Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d.update(Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d.update(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing *Iter* using d.update(%s)
            -d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError('iter',))
            +d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update(%s)
            d.update(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
            d.update({b"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            d.update(FailingNumber()):(<class 'TypeError'>, TypeError("'FailingNumber' object is not iterable",))
            <<< Finished
            >>> Testing StringToChars using d.update(((%s, 0),))
            @@ -677,15 +677,15 @@
            <<< Finished
            >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),))
            d.update((("a", {"abcF" : FailingIter()}),)):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d.update((("a", {"abcF" : FailingIterNext()}),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", {"abcF" : FailingIterNext()}),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),))
            d.update((("a", {"abcF" : None}),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d.update((("a", {"abcF" : {b"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update((("a", {"abcF" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", {"abcF" : FailingMappingKey()}),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", {"abcF" : FailingNumber()}),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update((("a", {"abcF" : FailingMappingKey()}),)):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d.update((("a", {"abcF" : FailingNumber()}),)):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
            d.update((("a", Mapping({1 : 1})),)):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -704,27 +704,27 @@
            <<< Finished
            >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),))
            d.update((("a", Mapping({"abcG" : FailingIter()})),)):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),))
            d.update((("a", Mapping({"abcG" : None})),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update((("a", Mapping({"abcG" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", Mapping({"abcG" : FailingNumber()})),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing *Iter* using d.update((("a", %s),))
            d.update((("a", FailingIter()),)):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -d.update((("a", FailingIterNext()),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", FailingIterNext()),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using d.update((("a", %s),))
            d.update((("a", None),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            d.update((("a", {b"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", FailingMappingKey()),)):(<class 'NotImplementedError'>, NotImplementedError())
            -d.update((("a", FailingNumber()),)):(<class 'NotImplementedError'>, NotImplementedError())
            +d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +d.update((("a", FailingMappingKey()),)):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +d.update((("a", FailingNumber()),)):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >> DictionaryPopItem
            d.popitem(1, 2):(<class 'TypeError'>, TypeError('popitem() takes no arguments (2 given)',))
            @@ -735,8 +735,8 @@
            vim.List(1, 2):(<class 'TypeError'>, TypeError('function takes at most 1 argument (2 given)',))
            vim.List(a=1):(<class 'TypeError'>, TypeError('list constructor does not accept keyword arguments',))
            >>> Testing *Iter* using vim.List(%s)
            -vim.List(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError('iter',))
            +vim.List(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing StringToChars using vim.List([{%s : 1}])
            vim.List([{1 : 1}]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -755,15 +755,15 @@
            <<< Finished
            >>> Testing *Iter* using vim.List([{"abcF" : %s}])
            vim.List([{"abcF" : FailingIter()}]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -vim.List([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
            vim.List([{"abcF" : None}]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            vim.List([{"abcF" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            vim.List([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +vim.List([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +vim.List([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
            vim.List([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -782,27 +782,27 @@
            <<< Finished
            >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})])
            vim.List([Mapping({"abcG" : FailingIter()})]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -vim.List([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
            vim.List([Mapping({"abcG" : None})]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            vim.List([Mapping({"abcG" : {b"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            vim.List([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +vim.List([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +vim.List([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing *Iter* using vim.List([%s])
            vim.List([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -vim.List([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using vim.List([%s])
            vim.List([None]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            vim.List([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
            -vim.List([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError())
            +vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +vim.List([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +vim.List([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >> ListItem
            l[1000]:(<class 'IndexError'>, IndexError('list index out of range',))
            @@ -812,8 +812,8 @@
            >> ListAssSlice
            ll[1:100] = "abcJ":(<class 'vim.error'>, error('list is locked',))
            >>> Testing *Iter* using l[:] = %s
            -l[:] = FailingIter():(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = FailingIterNext()::(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = FailingIter():(<class 'NotImplementedError'>, NotImplementedError('iter',))
            +l[:] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing StringToChars using l[:] = [{%s : 1}]
            l[:] = [{1 : 1}]:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -832,15 +832,15 @@
            <<< Finished
            >>> Testing *Iter* using l[:] = [{"abcF" : %s}]
            l[:] = [{"abcF" : FailingIter()}]:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -l[:] = [{"abcF" : FailingIterNext()}]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [{"abcF" : FailingIterNext()}]:(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}]
            l[:] = [{"abcF" : None}]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            l[:] = [{"abcF" : {b"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            l[:] = [{"abcF" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [{"abcF" : FailingMappingKey()}]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [{"abcF" : FailingNumber()}]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +l[:] = [{"abcF" : FailingMappingKey()}]:(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +l[:] = [{"abcF" : FailingNumber()}]:(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
            l[:] = [Mapping({1 : 1})]:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
            @@ -859,32 +859,32 @@
            <<< Finished
            >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})]
            l[:] = [Mapping({"abcG" : FailingIter()})]:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -l[:] = [Mapping({"abcG" : FailingIterNext()})]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [Mapping({"abcG" : FailingIterNext()})]:(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})]
            l[:] = [Mapping({"abcG" : None})]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            l[:] = [Mapping({"abcG" : {b"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            l[:] = [Mapping({"abcG" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [Mapping({"abcG" : FailingNumber()})]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +l[:] = [Mapping({"abcG" : FailingNumber()})]:(<class 'NotImplementedError'>, NotImplementedError('int',))
            <<< Finished
            >>> Testing *Iter* using l[:] = [%s]
            l[:] = [FailingIter()]:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
            -l[:] = [FailingIterNext()]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [FailingIterNext()]:(<class 'NotImplementedError'>, NotImplementedError('next',))
            <<< Finished
            >>> Testing ConvertFromPyObject using l[:] = [%s]
            l[:] = [None]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
            l[:] = [{b"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
            -l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [FailingMappingKey()]:(<class 'NotImplementedError'>, NotImplementedError())
            -l[:] = [FailingNumber()]:(<class 'NotImplementedError'>, NotImplementedError())
            +l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
            +l[:] = [FailingMappingKey()]:(<class 'NotImplementedError'>, NotImplementedError('getitem:mappingkey',))
            +l[:] = [FailingNumber()]:(<class 'NotImplementedError'>, NotImplementedError<br/><br/>(Message over 64 KB, truncated)
          • ZyX
            Fixes the Note: mentioned before. # HG changeset patch # User ZyX # Date 1371701162 -14400 # Thu Jun 20 08:06:02 2013 +0400 # Branch
            Message 5 of 25 , Jun 19, 2013
            • 0 Attachment
              Fixes the Note: mentioned before.

              # HG changeset patch
              # User ZyX <kp-pav@...>
              # Date 1371701162 -14400
              # Thu Jun 20 08:06:02 2013 +0400
              # Branch python-fixes
              # Node ID 32abf0ae95195d73a017a8d53af65e9deea20856
              # Parent 38acdea8fd7d2179916c4e67bdc8e54941929093
              Let non-ImportError exceptions pass the finder

              diff -r 38acdea8fd7d -r 32abf0ae9519 src/if_py_both.h
              --- a/src/if_py_both.h Wed Jun 19 23:10:21 2013 +0400
              +++ b/src/if_py_both.h Thu Jun 20 08:06:02 2013 +0400
              @@ -1199,6 +1199,14 @@

              if (!module)
              {
              + if (PyErr_Occurred())
              + {
              + if (PyErr_ExceptionMatches(PyExc_ImportError))
              + PyErr_Clear();
              + else
              + return NULL;
              + }
              +
              Py_INCREF(Py_None);
              return Py_None;
              }
              diff -r 38acdea8fd7d -r 32abf0ae9519 src/testdir/test86.ok
              --- a/src/testdir/test86.ok Wed Jun 19 23:10:21 2013 +0400
              +++ b/src/testdir/test86.ok Thu Jun 20 08:06:02 2013 +0400
              @@ -497,7 +497,7 @@
              > import
              import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
              import failing_import:ImportError:('No module named failing_import',)
              -import failing:ImportError:('No module named failing',)
              +import failing:NotImplementedError:()
              > Dictionary
              >> DictionaryConstructor
              vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
              diff -r 38acdea8fd7d -r 32abf0ae9519 src/testdir/test87.ok
              --- a/src/testdir/test87.ok Wed Jun 19 23:10:21 2013 +0400
              +++ b/src/testdir/test87.ok Thu Jun 20 08:06:02 2013 +0400
              @@ -486,7 +486,7 @@
              > import
              import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
              import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
              -import failing:(<class 'ImportError'>, ImportError('No module named failing',))
              +import failing:(<class 'NotImplementedError'>, NotImplementedError())
              > Dictionary
              >> DictionaryConstructor
              vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • ZyX
              Wrong patch. Correct one: # HG changeset patch # User ZyX # Date 1371441247 -14400 # Mon Jun 17 07:54:07 2013 +0400 # Branch python-fixes #
              Message 6 of 25 , Jun 19, 2013
              • 0 Attachment
                Wrong patch. Correct one:

                # HG changeset patch
                # User ZyX <kp-pav@...>
                # Date 1371441247 -14400
                # Mon Jun 17 07:54:07 2013 +0400
                # Branch python-fixes
                # Node ID 42e166b5c6ff07cd7810780b1d3704b8ce61bac0
                # Parent 4a00cd941a883917f6d740f9f06aca7baadcb45e
                Add NUMBER_UNSIGNED to WindowSetattr(, "width"|"height")
                And more tests

                Note: in ee('import failing') it was expected to raise NotImplementedError, but
                actually raises ImportError

                diff --git a/src/if_py_both.h b/src/if_py_both.h
                --- a/src/if_py_both.h
                +++ b/src/if_py_both.h
                @@ -3357,7 +3357,7 @@
                long height;
                win_T *savewin;

                - if (NumberToLong(valObject, &height, NUMBER_INT))
                + if (NumberToLong(valObject, &height, NUMBER_INT|NUMBER_UNSIGNED))
                return -1;

                #ifdef FEAT_GUI
                @@ -3380,7 +3380,7 @@
                long width;
                win_T *savewin;

                - if (NumberToLong(valObject, &width, NUMBER_INT))
                + if (NumberToLong(valObject, &width, NUMBER_INT|NUMBER_UNSIGNED))
                return -1;

                #ifdef FEAT_GUI
                diff --git a/src/testdir/pythonx/failing.py b/src/testdir/pythonx/failing.py
                new file mode 100644
                --- /dev/null
                +++ b/src/testdir/pythonx/failing.py
                @@ -0,0 +1,1 @@
                +raise NotImplementedError
                diff --git a/src/testdir/pythonx/failing_import.py b/src/testdir/pythonx/failing_import.py
                new file mode 100644
                --- /dev/null
                +++ b/src/testdir/pythonx/failing_import.py
                @@ -0,0 +1,1 @@
                +raise ImportError
                diff --git a/src/testdir/pythonx/topmodule/__init__.py b/src/testdir/pythonx/topmodule/__init__.py
                new file mode 100644
                diff --git a/src/testdir/pythonx/topmodule/submodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/__init__.py
                new file mode 100644
                diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py
                new file mode 100644
                diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                new file mode 100644
                diff --git a/src/testdir/test86.in b/src/testdir/test86.in
                --- a/src/testdir/test86.in
                +++ b/src/testdir/test86.in
                @@ -342,9 +342,9 @@
                EOF
                :py sys.settrace(traceit)
                :py trace_main()
                +:py sys.settrace(None)
                :py del traceit
                :py del trace_main
                -:py sys.settrace(None)
                :$put =string(l)
                :"
                :" Slice
                @@ -942,6 +942,7 @@
                '{u"": 1}', # Same, but with unicode object
                'FailingMapping()', #
                'FailingMappingKey()', #
                + 'FailingNumber()', #
                ))

                def convertfrompymapping_test(expr):
                @@ -956,6 +957,15 @@
                'FailingIterNext()',
                ))

                +def number_test(expr, natural=False, unsigned=False):
                + if natural:
                + unsigned = True
                + return subexpr_test(expr, 'NumberToLong', (
                + '[]',
                + 'None',
                + ) + (unsigned and ('-1',) or ())
                + + (natural and ('0',) or ()))
                +
                class FailingTrue(object):
                def __nonzero__(self):
                raise NotImplementedError
                @@ -992,30 +1002,59 @@
                else:
                return super(FailingList, self).__getitem__(idx)

                +class NoArgsCall(object):
                + def __call__(self):
                + pass
                +
                +class FailingCall(object):
                + def __call__(self, path):
                + raise NotImplementedError
                +
                +class FailingNumber(object):
                + def __int__(self):
                + raise NotImplementedError
                +
                cb.append("> Output")
                cb.append(">> OutputSetattr")
                ee('del sys.stdout.softspace')
                -ee('sys.stdout.softspace = []')
                +number_test('sys.stdout.softspace = %s', unsigned=True)
                +number_test('sys.stderr.softspace = %s', unsigned=True)
                ee('sys.stdout.attr = None')
                cb.append(">> OutputWrite")
                ee('sys.stdout.write(None)')
                cb.append(">> OutputWriteLines")
                ee('sys.stdout.writelines(None)')
                ee('sys.stdout.writelines([1])')
                -#iter_test('sys.stdout.writelines(%s)')
                +iter_test('sys.stdout.writelines(%s)')
                cb.append("> VimCommand")
                -ee('vim.command(1)')
                +stringtochars_test('vim.command(%s)')
                +ee('vim.command("", 2)')
                #! Not checked: vim->python exceptions translating: checked later
                cb.append("> VimToPython")
                #! Not checked: everything: needs errors in internal python functions
                cb.append("> VimEval")
                -ee('vim.eval(1)')
                +stringtochars_test('vim.eval(%s)')
                +ee('vim.eval("", FailingTrue())')
                #! Not checked: everything: needs errors in internal python functions
                cb.append("> VimEvalPy")
                -ee('vim.bindeval(1)')
                +stringtochars_test('vim.bindeval(%s)')
                +ee('vim.eval("", 2)')
                #! Not checked: vim->python exceptions translating: checked later
                cb.append("> VimStrwidth")
                -ee('vim.strwidth(1)')
                +stringtochars_test('vim.strwidth(%s)')
                +cb.append("> VimForeachRTP")
                +ee('vim.foreach_rtp(None)')
                +ee('vim.foreach_rtp(NoArgsCall())')
                +ee('vim.foreach_rtp(FailingCall())')
                +ee('vim.foreach_rtp(int, 2)')
                +cb.append('> import')
                +old_rtp = vim.options['rtp']
                +vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
                +ee('import xxx_no_such_module_xxx')
                +ee('import failing_import')
                +ee('import failing')
                +vim.options['rtp'] = old_rtp
                +del old_rtp
                cb.append("> Dictionary")
                cb.append(">> DictionaryConstructor")
                ee('vim.Dictionary("abcI")')
                @@ -1043,7 +1082,7 @@
                cb.append(">>> iter")
                ee('d.update(FailingMapping())')
                ee('d.update([FailingIterNext()])')
                -#iter_test('d.update(%s)')
                +iter_test('d.update(%s)')
                convertfrompyobject_test('d.update(%s)')
                stringtochars_test('d.update(((%s, 0),))')
                convertfrompyobject_test('d.update((("a", %s),))')
                @@ -1055,7 +1094,7 @@
                cb.append(">> ListConstructor")
                ee('vim.List(1, 2)')
                ee('vim.List(a=1)')
                -#iter_test('vim.List(%s)')
                +iter_test('vim.List(%s)')
                convertfrompyobject_test('vim.List([%s])')
                cb.append(">> ListItem")
                ee('l[1000]')
                @@ -1064,10 +1103,10 @@
                ee('l[1000] = 3')
                cb.append(">> ListAssSlice")
                ee('ll[1:100] = "abcJ"')
                -#iter_test('l[:] = %s')
                +iter_test('l[:] = %s')
                convertfrompyobject_test('l[:] = [%s]')
                cb.append(">> ListConcatInPlace")
                -#iter_test('l.extend(%s)')
                +iter_test('l.extend(%s)')
                convertfrompyobject_test('l.extend([%s])')
                cb.append(">> ListSetattr")
                ee('del l.locked')
                @@ -1094,14 +1133,15 @@
                ee('vim.current.window.buffer = 0')
                ee('vim.current.window.cursor = (100000000, 100000000)')
                ee('vim.current.window.cursor = True')
                -ee('vim.current.window.height = "abcK"')
                -ee('vim.current.window.width = "abcL"')
                +number_test('vim.current.window.height = %s', unsigned=True)
                +number_test('vim.current.window.width = %s', unsigned=True)
                ee('vim.current.window.xxxxxx = True')
                cb.append("> WinList")
                cb.append(">> WinListItem")
                ee('vim.windows[1000]')
                cb.append("> Buffer")
                cb.append(">> StringToLine (indirect)")
                +ee('vim.current.buffer[0] = u"\\na"')
                ee('vim.current.buffer[0] = "\\na"')
                cb.append(">> SetBufferLine (indirect)")
                ee('vim.current.buffer[0] = True')
                @@ -1129,8 +1169,8 @@
                ee('vim.current.buffer.range(1, 2, 3)')
                cb.append("> BufMap")
                cb.append(">> BufMapItem")
                -ee('vim.buffers[None]')
                ee('vim.buffers[100000000]')
                +number_test('vim.buffers[%s]', natural=True)
                cb.append("> Current")
                cb.append(">> CurrentGetattr")
                ee('vim.current.xxx')
                @@ -1154,12 +1194,16 @@
                del convertfrompyobject_test
                del convertfrompymapping_test
                del iter_test
                +del number_test
                del FailingTrue
                del FailingIter
                del FailingIterNext
                del FailingMapping
                del FailingMappingKey
                del FailingList
                +del NoArgsCall
                +del FailingCall
                +del FailingNumber
                EOF
                :delfunction F
                :"
                @@ -1168,6 +1212,16 @@
                sys.path.insert(0, os.path.join(os.getcwd(), 'python_before'))
                sys.path.append(os.path.join(os.getcwd(), 'python_after'))
                vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
                +l = []
                +def callback(path):
                + l.append(path[-len('/testdir'):])
                +vim.foreach_rtp(callback)
                +cb.append(repr(l))
                +del l
                +def callback(path):
                + return path[-len('/testdir'):]
                +cb.append(repr(vim.foreach_rtp(callback)))
                +del callback
                from module import dir as d
                from modulex import ddir
                cb.append(d + ',' + ddir)
                @@ -1175,10 +1229,19 @@
                cb.append(before.dir)
                import after
                cb.append(after.dir)
                +import topmodule as tm
                +import topmodule.submodule as tms
                +import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss
                +cb.append(tm.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/__init__.py'):])
                +cb.append(tms.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/__init__.py'):])
                +cb.append(tmsss.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):])
                del before
                del after
                del d
                del ddir
                +del tm
                +del tms
                +del tmsss
                EOF
                :"
                :" Test exceptions
                diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok
                --- a/src/testdir/test86.ok
                +++ b/src/testdir/test86.ok
                @@ -441,22 +441,63 @@
                > Output
                >> OutputSetattr
                del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",)
                +>>> Testing NumberToLong using sys.stdout.softspace = %s
                sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
                +sys.stdout.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
                +sys.stdout.softspace = -1:ValueError:('number must be greater or equal to zero',)
                +<<< Finished
                +>>> Testing NumberToLong using sys.stderr.softspace = %s
                +sys.stderr.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
                +sys.stderr.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
                +sys.stderr.softspace = -1:ValueError:('number must be greater or equal to zero',)
                +<<< Finished
                sys.stdout.attr = None:AttributeError:('invalid attribute: attr',)
                >> OutputWrite
                sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',)
                >> OutputWriteLines
                sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",)
                sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',)
                +>>> Testing *Iter* using sys.stdout.writelines(%s)
                +sys.stdout.writelines(FailingIter()):NotImplementedError:()
                +sys.stdout.writelines(FailingIterNext()):NotImplementedError:()
                +<<< Finished
                > VimCommand
                +>>> Testing StringToChars using vim.command(%s)
                vim.command(1):TypeError:('expected str() or unicode() instance, but got int',)
                +vim.command(u"\0"):TypeError:('expected string without null bytes',)
                +vim.command("\0"):TypeError:('expected string without null bytes',)
                +<<< Finished
                +vim.command("", 2):TypeError:('command() takes exactly one argument (2 given)',)
                > VimToPython
                > VimEval
                +>>> Testing StringToChars using vim.eval(%s)
                vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',)
                +vim.eval(u"\0"):TypeError:('expected string without null bytes',)
                +vim.eval("\0"):TypeError:('expected string without null bytes',)
                +<<< Finished
                +vim.eval("", FailingTrue()):TypeError:('function takes exactly 1 argument (2 given)',)
                > VimEvalPy
                +>>> Testing StringToChars using vim.bindeval(%s)
                vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',)
                +vim.bindeval(u"\0"):TypeError:('expected string without null bytes',)
                +vim.bindeval("\0"):TypeError:('expected string without null bytes',)
                +<<< Finished
                +vim.eval("", 2):TypeError:('function takes exactly 1 argument (2 given)',)
                > VimStrwidth
                +>>> Testing StringToChars using vim.strwidth(%s)
                vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',)
                +vim.strwidth(u"\0"):TypeError:('expected string without null bytes',)
                +vim.strwidth("\0"):TypeError:('expected string without null bytes',)
                +<<< Finished
                +> VimForeachRTP
                +vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",)
                +vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',)
                +vim.foreach_rtp(FailingCall()):NotImplementedError:()
                +vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',)
                +> import
                +import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
                +import failing_import:ImportError:('No module named failing_import',)
                +import failing:ImportError:('No module named failing',)
                > Dictionary
                >> DictionaryConstructor
                vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
                @@ -509,6 +550,7 @@
                d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
                d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:()
                d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:()
                +d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
                d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -535,6 +577,7 @@
                d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',)
                d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:()
                d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:()
                +d["a"] = Mapping({"abcG" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using d["a"] = %s
                d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',)
                @@ -546,12 +589,17 @@
                d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',)
                d["a"] = FailingMapping():NotImplementedError:()
                d["a"] = FailingMappingKey():NotImplementedError:()
                +d["a"] = FailingNumber():TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >> DictionaryUpdate
                >>> kwargs
                >>> iter
                d.update(FailingMapping()):NotImplementedError:()
                d.update([FailingIterNext()]):NotImplementedError:()
                +>>> Testing *Iter* using d.update(%s)
                +d.update(FailingIter()):NotImplementedError:()
                +d.update(FailingIterNext()):NotImplementedError:()
                +<<< Finished
                >>> Testing StringToChars using d.update({%s : 1})
                d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
                d.update({u"\0" : 1}):TypeError:('expected string without null bytes',)
                @@ -577,6 +625,7 @@
                d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
                d.update({"abcF" : FailingMapping()}):NotImplementedError:()
                d.update({"abcF" : FailingMappingKey()}):NotImplementedError:()
                +d.update({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using d.update(Mapping({%s : 1}))
                d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -603,6 +652,7 @@
                d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
                d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
                d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
                +d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using d.update(%s)
                d.update(FailingIter()):NotImplementedError:()
                @@ -614,6 +664,7 @@
                d.update({u"": 1}):ValueError:('empty keys are not allowed',)
                d.update(FailingMapping()):NotImplementedError:()
                d.update(FailingMappingKey()):NotImplementedError:()
                +d.update(FailingNumber()):TypeError:('iteration over non-sequence',)
                <<< Finished
                >>> Testing StringToChars using d.update(((%s, 0),))
                d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -645,6 +696,7 @@
                d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
                d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:()
                d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:()
                +d.update((("a", {"abcF" : FailingNumber()}),)):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
                d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -671,6 +723,7 @@
                d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
                d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:()
                d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:()
                +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using d.update((("a", %s),))
                d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',)
                @@ -682,6 +735,7 @@
                d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',)
                d.update((("a", FailingMapping()),)):NotImplementedError:()
                d.update((("a", FailingMappingKey()),)):NotImplementedError:()
                +d.update((("a", FailingNumber()),)):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >> DictionaryPopItem
                d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',)
                @@ -691,6 +745,10 @@
                >> ListConstructor
                vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',)
                vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',)
                +>>> Testing *Iter* using vim.List(%s)
                +vim.List(FailingIter()):NotImplementedError:()
                +vim.List(FailingIterNext()):NotImplementedError:()
                +<<< Finished
                >>> Testing StringToChars using vim.List([{%s : 1}])
                vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
                vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
                @@ -716,6 +774,7 @@
                vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
                vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:()
                vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
                +vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
                vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -742,6 +801,7 @@
                vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
                vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
                vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
                +vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using vim.List([%s])
                vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
                @@ -753,6 +813,7 @@
                vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',)
                vim.List([FailingMapping()]):NotImplementedError:()
                vim.List([FailingMappingKey()]):NotImplementedError:()
                +vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >> ListItem
                l[1000]:IndexError:('list index out of range',)
                @@ -761,6 +822,10 @@
                l[1000] = 3:IndexError:('list index out of range',)
                >> ListAssSlice
                ll[1:100] = "abcJ":error:('list is locked',)
                +>>> Testing *Iter* using l[:] = %s
                +l[:] = FailingIter():NotImplementedError:()
                +l[:] = FailingIterNext():NotImplementedError:()
                +<<< Finished
                >>> Testing StringToChars using l[:] = [{%s : 1}]
                l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',)
                l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',)
                @@ -786,6 +851,7 @@
                l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
                l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:()
                l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:()
                +l[:] = [{"abcF" : FailingNumber()}]:TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
                l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',)
                @@ -812,6 +878,7 @@
                l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
                l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:()
                l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:()
                +l[:] = [Mapping({"abcG" : FailingNumber()})]:TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using l[:] = [%s]
                l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',)
                @@ -823,8 +890,13 @@
                l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',)
                l[:] = [FailingMapping()]:NotImplementedError:()
                l[:] = [FailingMappingKey()]:NotImplementedError:()
                +l[:] = [FailingNumber()]:TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >> ListConcatInPlace
                +>>> Testing *Iter* using l.extend(%s)
                +l.extend(FailingIter()):NotImplementedError:()
                +l.extend(FailingIterNext()):NotImplementedError:()
                +<<< Finished
                >>> Testing StringToChars using l.extend([{%s : 1}])
                l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
                l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
                @@ -850,6 +922,7 @@
                l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
                l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:()
                l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:()
                +l.extend([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
                l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -876,6 +949,7 @@
                l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
                l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:()
                l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:()
                +l.extend([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using l.extend([%s])
                l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',)
                @@ -887,6 +961,7 @@
                l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',)
                l.extend([FailingMapping()]):NotImplementedError:()
                l.extend([FailingMappingKey()]):NotImplementedError:()
                +l.extend([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >> ListSetattr
                del l.locked:AttributeError:('cannot delete vim.List attributes',)
                @@ -923,6 +998,7 @@
                f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
                f({"abcF" : FailingMapping()}):NotImplementedError:()
                f({"abcF" : FailingMappingKey()}):NotImplementedError:()
                +f({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using f(Mapping({%s : 1}))
                f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -949,6 +1025,7 @@
                f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
                f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
                f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
                +f(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using f(%s)
                f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',)
                @@ -960,6 +1037,7 @@
                f({u"": 1}):ValueError:('empty keys are not allowed',)
                f(FailingMapping()):NotImplementedError:()
                f(FailingMappingKey()):NotImplementedError:()
                +f(FailingNumber()):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using fd(self={%s : 1})
                fd(self={1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -986,6 +1064,7 @@
                fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
                fd(self={"abcF" : FailingMapping()}):NotImplementedError:()
                fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:()
                +fd(self={"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing StringToChars using fd(self=Mapping({%s : 1}))
                fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',)
                @@ -1012,6 +1091,7 @@
                fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
                fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
                fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
                +fd(self=Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
                <<< Finished
                >>> Testing *Iter* using fd(self=%s)
                fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',)
                @@ -1023,6 +1103,7 @@
                fd(self={u"": 1}):ValueError:('empty keys are not allowed',)
                fd(self=FailingMapping()):NotImplementedError:()
                fd(self=FailingMappingKey()):NotImplementedError:()
                +fd(self=FailingNumber()):TypeError:('unable to convert FailingNumber to vim dictionary',)
                <<< Finished
                >>> Testing ConvertFromPyMapping using fd(self=%s)
                fd(self=[]):TypeError:('unable to convert object to vim dictionary',)
                @@ -1040,14 +1121,23 @@
                vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',)
                vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',)
                vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',)
                -vim.current.window.height = "abcK":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',)
                -vim.current.window.width = "abcL":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',)
                +>>> Testing NumberToLong using vim.current.window.height = %s
                +vim.current.window.height = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
                +vim.current.window.height = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
                +vim.current.window.height = -1:ValueError:('number must be greater or equal to zero',)
                +<<< Finished
                +>>> Testing NumberToLong using vim.current.window.width = %s
                +vim.current.window.width = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
                +vim.current.window.width = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
                +vim.current.window.width = -1:ValueError:('number must be greater or equal to zero',)
                +<<< Finished
                vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',)
                > WinList
                >> WinListItem
                vim.windows[1000]:IndexError:('no such window',)
                > Buffer
                >> StringToLine (indirect)
                +vim.current.buffer[0] = u"\na":error:('string cannot contain newlines',)
                vim.current.buffer[0] = "\na":error:('string cannot contain newlines',)
                >> SetBufferLine (indirect)
                vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',)
                @@ -1075,8 +1165,13 @@
                vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',)
                > BufMap
                >> BufMapItem
                +vim.buffers[100000000]:KeyError:(100000000,)
                +>>> Testing NumberToLong using vim.buffers[%s]
                +vim.buffers[[]]:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',)
                vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',)
                -vim.buffers[100000000]:KeyError:(100000000,)
                +vim.buffers[-1]:ValueError:('number must be greater then zero',)
                +vim.buffers[0]:ValueError:('number must be greater then zero',)
                +<<< Finished
                > Current
                >> CurrentGetattr
                vim.current.xxx:AttributeError:('xxx',)
                @@ -1086,9 +1181,14 @@
                vim.current.window = True:TypeError:('expected vim.Window object, but got bool',)
                vim.current.tabpage = True:TypeError:('expected vim.TabPage object, but got bool',)
                vim.current.xxx = True:AttributeError:('xxx',)
                +['/testdir']
                +'/testdir'
                2,xx
                before
                after
                +pythonx/topmodule/__init__.py
                +pythonx/topmodule/submodule/__init__.py
                +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                vim.command("throw 'abcN'"):error:('abcN',)
                Exe("throw 'def'"):error:('def',)
                vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
                diff --git a/src/testdir/test87.in b/src/testdir/test87.in
                --- a/src/testdir/test87.in
                +++ b/src/testdir/test87.in
                @@ -335,9 +335,9 @@
                EOF
                :py3 sys.settrace(traceit)
                :py3 trace_main()
                +:py3 sys.settrace(None)
                :py3 del traceit
                :py3 del trace_main
                -:py3 sys.settrace(None)
                :$put =string(l)
                :"
                :" Vars
                @@ -898,6 +898,7 @@
                '{"": 1}', # Same, but with unicode object
                'FailingMapping()', #
                'FailingMappingKey()', #
                + 'FailingNumber()', #
                ))

                def convertfrompymapping_test(expr):
                @@ -912,6 +913,15 @@
                'FailingIterNext()',
                ))

                +def number_test(expr, natural=False, unsigned=False):
                + if natural:
                + unsigned = True
                + return subexpr_test(expr, 'NumberToLong', (
                + '[]',
                + 'None',
                + ) + (('-1',) if unsigned else ())
                + + (('0',) if natural else ()))
                +
                class FailingTrue(object):
                def __bool__(self):
                raise NotImplementedError
                @@ -948,10 +958,23 @@
                else:
                return super(FailingList, self).__getitem__(idx)

                +class NoArgsCall(object):
                + def __call__(self):
                + pass
                +
                +class FailingCall(object):
                + def __call__(self, path):
                + raise NotImplementedError
                +
                +class FailingNumber(object):
                + def __int__(self):
                + raise NotImplementedError
                +
                cb.append("> Output")
                cb.append(">> OutputSetattr")
                ee('del sys.stdout.softspace')
                -ee('sys.stdout.softspace = []')
                +number_test('sys.stdout.softspace = %s', unsigned=True)
                +number_test('sys.stderr.softspace = %s', unsigned=True)
                ee('sys.stdout.attr = None')
                cb.append(">> OutputWrite")
                ee('sys.stdout.write(None)')
                @@ -960,18 +983,34 @@
                ee('sys.stdout.writelines([1])')
                iter_test('sys.stdout.writelines(%s)')
                cb.append("> VimCommand")
                -ee('vim.command(1)')
                +stringtochars_test('vim.command(%s)')
                +ee('vim.command("", 2)')
                #! Not checked: vim->python exceptions translating: checked later
                cb.append("> VimToPython")
                #! Not checked: everything: needs errors in internal python functions
                cb.append("> VimEval")
                -ee('vim.eval(1)')
                +stringtochars_test('vim.eval(%s)')
                +ee('vim.eval("", FailingTrue())')
                #! Not checked: everything: needs errors in internal python functions
                cb.append("> VimEvalPy")
                -ee('vim.bindeval(1)')
                +stringtochars_test('vim.bindeval(%s)')
                +ee('vim.eval("", 2)')
                #! Not checked: vim->python exceptions translating: checked later
                cb.append("> VimStrwidth")
                -ee('vim.strwidth(1)')
                +stringtochars_test('vim.strwidth(%s)')
                +cb.append("> VimForeachRTP")
                +ee('vim.foreach_rtp(None)')
                +ee('vim.foreach_rtp(NoArgsCall())')
                +ee('vim.foreach_rtp(FailingCall())')
                +ee('vim.foreach_rtp(int, 2)')
                +cb.append('> import')
                +old_rtp = vim.options['rtp']
                +vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
                +ee('import xxx_no_such_module_xxx')
                +ee('import failing_import')
                +ee('import failing')
                +vim.options['rtp'] = old_rtp
                +del old_rtp
                cb.append("> Dictionary")
                cb.append(">> DictionaryConstructor")
                ee('vim.Dictionary("abcI")')
                @@ -1050,8 +1089,8 @@
                ee('vim.current.window.buffer = 0')
                ee('vim.current.window.cursor = (100000000, 100000000)')
                ee('vim.current.window.cursor = True')
                -ee('vim.current.window.height = "abcK"')
                -ee('vim.current.window.width = "abcL"')
                +number_test('vim.current.window.height = %s', unsigned=True)
                +number_test('vim.current.window.width = %s', unsigned=True)
                ee('vim.current.window.xxxxxx = True')
                cb.append("> WinList")
                cb.append(">> WinListItem")
                @@ -1059,6 +1098,7 @@
                cb.append("> Buffer")
                cb.append(">> StringToLine (indirect)")
                ee('vim.current.buffer[0] = "\\na"')
                +ee('vim.current.buffer[0] = b"\\na"')
                cb.append(">> SetBufferLine (indirect)")
                ee('vim.current.buffer[0] = True')
                cb.append(">> SetBufferLineList (indirect)")
                @@ -1085,8 +1125,8 @@
                ee('vim.current.buffer.range(1, 2, 3)')
                cb.append("> BufMap")
                cb.append(">> BufMapItem")
                -ee('vim.buffers[None]')
                ee('vim.buffers[100000000]')
                +number_test('vim.buffers[%s]', natural=True)
                cb.append("> Current")
                cb.append(">> CurrentGetattr")
                ee('vim.current.xxx')
                @@ -1110,12 +1150,16 @@
                del convertfrompyobject_test
                del convertfrompymapping_test
                del iter_test
                +del number_test
                del FailingTrue
                del FailingIter
                del FailingIterNext
                del FailingMapping
                del FailingMappingKey
                del FailingList
                +del NoArgsCall
                +del FailingCall
                +del FailingNumber
                EOF
                :delfunction F
                :"
                @@ -1124,6 +1168,16 @@
                sys.path.insert(0, os.path.join(os.getcwd(), 'python_before'))
                sys.path.append(os.path.join(os.getcwd(), 'python_after'))
                vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
                +l = []
                +def callback(path):
                + l.append(os.path.relpath(path))
                +vim.foreach_rtp(callback)
                +cb.append(repr(l))
                +del l
                +def callback(path):
                + return os.path.relpath(path)
                +cb.append(repr(vim.foreach_rtp(callback)))
                +del callback
                from module import dir as d
                from modulex import ddir
                cb.append(d + ',' + ddir)
                @@ -1131,10 +1185,19 @@
                cb.append(before.dir)
                import after
                cb.append(after.dir)
                +import topmodule as tm
                +import topmodule.submodule as tms
                +import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss
                +cb.append(tm.__file__[-len('modulex/topmodule/__init__.py'):])
                +cb.append(tms.__file__[-len('modulex/topmodule/submodule/__init__.py'):])
                +cb.append(tmsss.__file__[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):])
                del before
                del after
                del d
                del ddir
                +del tm
                +del tms
                +del tmsss
                EOF
                :"
                :" Test exceptions
                diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok
                --- a/src/testdir/test87.ok
                +++ b/src/testdir/test87.ok
                @@ -430,7 +430,16 @@
                > Output
                >> OutputSetattr
                del sys.stdout.softspace:(<class 'AttributeError'>, AttributeError("can't delete OutputObject attributes",))
                +>>> Testing NumberToLong using sys.stdout.softspace = %s
                sys.stdout.softspace = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
                +sys.stdout.softspace = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
                +sys.stdout.softspace = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
                +<<< Finished
                +>>> Testing NumberToLong using sys.stderr.softspace = %s
                +sys.stderr.softspace = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
                +sys.stderr.softspace = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
                +sys.stderr.softspace = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
                +<<< Finished
                sys.stdout.attr = None:(<class 'AttributeError'>, AttributeError('invalid attribute: attr',))
                >> OutputWrite
                sys.stdout.write(None):(<class 'TypeError'>, TypeError("Can't convert 'NoneType' object to str implicitly",))
                @@ -442,14 +451,42 @@
                sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                > VimCommand
                +>>> Testing StringToChars using vim.command(%s)
                vim.command(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                +vim.command(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +vim.command("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +<<< Finished
                +vim.command("", 2):(<class 'TypeError'>, TypeError('command() takes exactly one argument (2 given)',))
                > VimToPython
                > VimEval
                +>>> Testing StringToChars using vim.eval(%s)
                vim.eval(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                +vim.eval(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +vim.eval("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +<<< Finished
                +vim.eval("", FailingTrue()):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
                > VimEvalPy
                +>>> Testing StringToChars using vim.bindeval(%s)
                vim.bindeval(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                +vim.bindeval(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +vim.bindeval("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +<<< Finished
                +vim.eval("", 2):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
                > VimStrwidth
                +>>> Testing StringToChars using vim.strwidth(%s)
                vim.strwidth(1):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                +vim.strwidth(b"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +vim.strwidth("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
                +<<< Finished
                +> VimForeachRTP
                +vim.foreach_rtp(None):(<class 'TypeError'>, TypeError("'NoneType' object is not callable",))
                +vim.foreach_rtp(NoArgsCall()):(<class 'TypeError'>, TypeError('__call__() takes exactly 1 positional argument (2 given)',))
                +vim.foreach_rtp(FailingCall()):(<class 'NotImplementedError'>, NotImplementedError())
                +vim.foreach_rtp(int, 2):(<class 'TypeError'>, TypeError('foreach_rtp() takes exactly one argument (2 given)',))
                +> import
                +import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
                +import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
                +import failing:(<class 'ImportError'>, ImportError('No module named failing',))
                > Dictionary
                >> DictionaryConstructor
                vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))
                @@ -502,6 +539,7 @@
                d["a"] = {"abcF" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError())
                d["a"] = {"abcF" : FailingMappingKey()}:(<class 'NotImplementedError'>, NotImplementedError())
                +d["a"] = {"abcF" : FailingNumber()}:(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
                d["a"] = Mapping({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -528,6 +566,7 @@
                d["a"] = Mapping({"abcG" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
                d["a"] = Mapping({"abcG" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
                +d["a"] = Mapping({"abcG" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using d["a"] = %s
                d["a"] = FailingIter():(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -539,6 +578,7 @@
                d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError())
                d["a"] = FailingMappingKey():(<class 'NotImplementedError'>, NotImplementedError())
                +d["a"] = FailingNumber():(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >> DictionaryUpdate
                >>> kwargs
                @@ -574,6 +614,7 @@
                d.update({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
                d.update({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using d.update(Mapping({%s : 1}))
                d.update(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -600,6 +641,7 @@
                d.update(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
                d.update(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using d.update(%s)
                d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
                @@ -611,6 +653,7 @@
                d.update({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
                d.update(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update(FailingNumber()):(<class 'TypeError'>, TypeError("'FailingNumber' object is not iterable",))
                <<< Finished
                >>> Testing StringToChars using d.update(((%s, 0),))
                d.update(((1, 0),)):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -642,6 +685,7 @@
                d.update((("a", {"abcF" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError())
                d.update((("a", {"abcF" : FailingMappingKey()}),)):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update((("a", {"abcF" : FailingNumber()}),)):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
                d.update((("a", Mapping({1 : 1})),)):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -668,6 +712,7 @@
                d.update((("a", Mapping({"abcG" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError())
                d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using d.update((("a", %s),))
                d.update((("a", FailingIter()),)):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -679,6 +724,7 @@
                d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError())
                d.update((("a", FailingMappingKey()),)):(<class 'NotImplementedError'>, NotImplementedError())
                +d.update((("a", FailingNumber()),)):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >> DictionaryPopItem
                d.popitem(1, 2):(<class 'TypeError'>, TypeError('popitem() takes no arguments (2 given)',))
                @@ -717,6 +763,7 @@
                vim.List([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
                vim.List([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
                +vim.List([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
                vim.List([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -743,6 +790,7 @@
                vim.List([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
                vim.List([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
                +vim.List([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using vim.List([%s])
                vim.List([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -754,6 +802,7 @@
                vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
                vim.List([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
                +vim.List([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >> ListItem
                l[1000]:(<class 'IndexError'>, IndexError('list index out of range',))
                @@ -791,6 +840,7 @@
                l[:] = [{"abcF" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError())
                l[:] = [{"abcF" : FailingMappingKey()}]:(<class 'NotImplementedError'>, NotImplementedError())
                +l[:] = [{"abcF" : FailingNumber()}]:(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
                l[:] = [Mapping({1 : 1})]:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -817,6 +867,7 @@
                l[:] = [Mapping({"abcG" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError())
                l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(<class 'NotImplementedError'>, NotImplementedError())
                +l[:] = [Mapping({"abcG" : FailingNumber()})]:(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using l[:] = [%s]
                l[:] = [FailingIter()]:(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -828,6 +879,7 @@
                l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError())
                l[:] = [FailingMappingKey()]:(<class 'NotImplementedError'>, NotImplementedError())
                +l[:] = [FailingNumber()]:(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >> ListConcatInPlace
                >>> Testing *Iter* using l.extend(%s)
                @@ -859,6 +911,7 @@
                l.extend([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l.extend([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
                l.extend([{"abcF" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
                +l.extend([{"abcF" : FailingNumber()}]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using l.extend([Mapping({%s : 1})])
                l.extend([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -885,6 +938,7 @@
                l.extend([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l.extend([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
                l.extend([Mapping({"abcG" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
                +l.extend([Mapping({"abcG" : FailingNumber()})]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using l.extend([%s])
                l.extend([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -896,6 +950,7 @@
                l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                l.extend([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
                l.extend([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
                +l.extend([FailingNumber()]):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >> ListSetattr
                del l.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.List attributes',))
                @@ -932,6 +987,7 @@
                f({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                f({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
                f({"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
                +f({"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using f(Mapping({%s : 1}))
                f(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -958,6 +1014,7 @@
                f(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                f(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
                f(Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
                +f(Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using f(%s)
                f(FailingIter()):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim structure',))
                @@ -969,6 +1026,7 @@
                f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
                f(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
                +f(FailingNumber()):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using fd(self={%s : 1})
                fd(self={1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -995,6 +1053,7 @@
                fd(self={"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                fd(self={"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
                fd(self={"abcF" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
                +fd(self={"abcF" : FailingNumber()}):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing StringToChars using fd(self=Mapping({%s : 1}))
                fd(self=Mapping({1 : 1})):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
                @@ -1021,6 +1080,7 @@
                fd(self=Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                fd(self=Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
                fd(self=Mapping({"abcG" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
                +fd(self=Mapping({"abcG" : FailingNumber()})):(<class 'NotImplementedError'>, NotImplementedError())
                <<< Finished
                >>> Testing *Iter* using fd(self=%s)
                fd(self=FailingIter()):(<class 'TypeError'>, TypeError('unable to convert FailingIter to vim dictionary',))
                @@ -1032,6 +1092,7 @@
                fd(self={"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
                fd(self=FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
                fd(self=FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
                +fd(self=FailingNumber()):(<class 'TypeError'>, TypeError('unable to convert FailingNumber to vim dictionary',))
                <<< Finished
                >>> Testing ConvertFromPyMapping using fd(self=%s)
                fd(self=[]):(<class 'AttributeError'>, AttributeError('keys',))
                @@ -1049,8 +1110,16 @@
                vim.current.window.buffer = 0:(<class 'TypeError'>, TypeError('readonly attribute: buffer',))
                vim.current.window.cursor = (100000000, 100000000):(<class 'vim.error'>, error('cursor position outside buffer',))
                vim.current.window.cursor = True:(<class 'TypeError'>, TypeError('argument must be 2-item sequence, not bool',))
                -vim.current.window.height = "abcK":(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got str',))
                -vim.current.window.width = "abcL":(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got str',))
                +>>> Testing NumberToLong using vim.current.window.height = %s
                +vim.current.window.height = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
                +vim.current.window.height = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
                +vim.current.window.height = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
                +<<< Finished
                +>>> Testing NumberToLong using vim.current.window.width = %s
                +vim.current.window.width = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
                +vim.current.window.width = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
                +vim.current.window.width = -1:(<class 'ValueError'>, ValueError('number must be greater or equal to zero',))
                +<<< Finished
                vim.current.window.xxxxxx = True:(<class 'AttributeError'>, AttributeError('xxxxxx',))
                > WinList
                >> WinListItem
                @@ -1058,6 +1127,7 @@
                > Buffer
                >> StringToLine (indirect)
                vim.current.buffer[0] = "\na":(<class 'vim.error'>, error('string cannot contain newlines',))
                +vim.current.buffer[0] = b"\na":(<class 'vim.error'>, error('string cannot contain newlines',))
                >> SetBufferLine (indirect)
                vim.current.buffer[0] = True:(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
                >> SetBufferLineList (indirect)
                @@ -1084,8 +1154,13 @@
                vim.current.buffer.range(1, 2, 3):(<class 'TypeError'>, TypeError('function takes exactly 2 arguments (3 given)',))
                > BufMap
                >> BufMapItem
                +vim.buffers[100000000]:(<class 'KeyError'>, KeyError(100000000,))
                +>>> Testing NumberToLong using vim.buffers[%s]
                +vim.buffers[[]]:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
                vim.buffers[None]:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
                -vim.buffers[100000000]:(<class 'KeyError'>, KeyError(100000000,))
                +vim.buffers[-1]:(<class 'ValueError'>, ValueError('number must be greater then zero',))
                +vim.buffers[0]:(<class 'ValueError'>, ValueError('number must be greater then zero',))
                +<<< Finished
                > Current
                >> CurrentGetattr
                vim.current.xxx:(<class 'AttributeError'>, AttributeError("'vim.currentdata' object has no attribute 'xxx'",))
                @@ -1095,9 +1170,14 @@
                vim.current.window = True:(<class 'TypeError'>, TypeError('expected vim.Window object, but got bool',))
                vim.current.tabpage = True:(<class 'TypeError'>, TypeError('expected vim.TabPage object, but got bool',))
                vim.current.xxx = True:(<class 'AttributeError'>, AttributeError('xxx',))
                +['.']
                +'.'
                3,xx
                before
                after
                +pythonx/topmodule/__init__.py
                +pythonx/topmodule/submodule/__init__.py
                +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                vim.command("throw 'abcN'"):(<class 'vim.error'>, error('abcN',))
                Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
                vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Bram Moolenaar
                ... Unfortunately this breaks all translations. E.g.: @@ -120,7 +122,7 @@ } else { - PyErr_SetString(PyExc_TypeError, _( object must be string )); +
                Message 7 of 25 , Jun 23, 2013
                • 0 Attachment
                  ZyX wrote:

                  > # HG changeset patch
                  > # User ZyX <kp-pav@...>
                  > # Date 1371238936 -14400
                  > # Fri Jun 14 23:42:16 2013 +0400
                  > # Branch python-fixes
                  > # Node ID abcf5d9458ee826516c1051cfd14d279b1097174
                  > # Parent b9d4dfa09951d4fb75972df34802675edf24a17e
                  > Make macros do translation of exception messages
                  >
                  > Reason: it will be easy to delete/restore translating

                  Unfortunately this breaks all translations. E.g.:

                  @@ -120,7 +122,7 @@
                  }
                  else
                  {
                  - PyErr_SetString(PyExc_TypeError, _("object must be string"));
                  + PyErr_SET_STRING(PyExc_TypeError, "object must be string");
                  return NULL;
                  }

                  This string will not be translated. It should have been:

                  + PyErr_SET_STRING(PyExc_TypeError, N_("object must be string"));

                  The N_() macro marks a string as translatable.

                  I'll include this patch now, since otherwise there will be problems with
                  all following patches. But please fix this ASAP.


                  --
                  GOD: That is your purpose Arthur ... the Quest for the Holy Grail ...
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                  /// Bram Moolenaar -- Bram@... -- 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 ///

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Bram Moolenaar
                  ... This patch causes test 86 to fail: 1025c1025
                  Message 8 of 25 , Jun 23, 2013
                  • 0 Attachment
                    ZyX wrote:

                    > # HG changeset patch
                    > # User ZyX <kp-pav@...>
                    > # Date 1371375798 -14400
                    > # Sun Jun 16 13:43:18 2013 +0400
                    > # Branch python-fixes
                    > # Node ID 81c6385adb920b486a9f3b912de3b7e86e57569d
                    > # Parent abcf5d9458ee826516c1051cfd14d279b1097174
                    > Make exception messages more verbose

                    This patch causes test 86 to fail:

                    1025c1025
                    < fd(self=[]):TypeError:('unable to convert list to vim dictionary',)
                    ---
                    > fd(self=[]):TypeError:('unable to convert object to vim dictionary',)

                    I'll change the .ok file to work around it, but pleae check the cause of
                    the failure.


                    --
                    "Time flies like an arrow". So I put an arrow on my desk, now
                    awaiting one of these time flies showing up.

                    /// Bram Moolenaar -- Bram@... -- 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 ///

                    --
                    --
                    You received this message from the "vim_dev" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • ZyX
                    ... I do not understand. `_()` was moved into the macros. How is PyErr_SET_STRING(exc, message ) different from PyErr_SetString(exc, _( message )) if macros
                    Message 9 of 25 , Jun 23, 2013
                    • 0 Attachment
                      On Sunday, June 23, 2013 3:27:39 PM UTC+4, Bram Moolenaar wrote:
                      > ZyX wrote:
                      >
                      > > # HG changeset patch
                      > > # User ZyX <kp-pav@...>
                      > > # Date 1371238936 -14400
                      > > # Fri Jun 14 23:42:16 2013 +0400
                      > > # Branch python-fixes
                      > > # Node ID abcf5d9458ee826516c1051cfd14d279b1097174
                      > > # Parent b9d4dfa09951d4fb75972df34802675edf24a17e
                      > > Make macros do translation of exception messages
                      > >
                      > > Reason: it will be easy to delete/restore translating
                      >
                      > Unfortunately this breaks all translations. E.g.:
                      >
                      > @@ -120,7 +122,7 @@
                      > }
                      > else
                      > {
                      > - PyErr_SetString(PyExc_TypeError, _("object must be string"));
                      > + PyErr_SET_STRING(PyExc_TypeError, "object must be string");
                      > return NULL;
                      > }
                      >
                      > This string will not be translated. It should have been:
                      >
                      > + PyErr_SET_STRING(PyExc_TypeError, N_("object must be string"));
                      >
                      > The N_() macro marks a string as translatable.
                      >
                      > I'll include this patch now, since otherwise there will be problems with
                      > all following patches. But please fix this ASAP.

                      I do not understand. `_()` was moved into the macros. How is PyErr_SET_STRING(exc, "message") different from PyErr_SetString(exc, _("message")) if macros `PyErr_SET_STRING(exc, msg)` is defined to `PyErr_SetString(exc, _(msg))`?

                      If I need to have `N_()` there (in the macros definition) I will write a patch, but I won't write `PyErr_SET_STRING(exc, N_(msg))`. It is the very intention: move all _() out of the code to the macros in case I find some better argument to not ever translate any exception messages then I have currently.

                      ---

                      Just tested: translations do work. Steps to reproduce:

                      src/vim -u NONE -N -c 'lang ru_RU.UTF-8' -c 'py import vim' -c 'py b=vim.current.buffer' -c 'bw!' -c 'py print b.name' a

                      . If this locale is supported it prints "vim.error: попытка сослаться на уничтоженный буфер" in place of "vim.error: attempt to refer to deleted buffer".

                      --
                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • Bram Moolenaar
                      ... Please follow my instructions. gettext searches the source code for _() and N_() , nothing else. After patch 7.3.1229 existing translations will work,
                      Message 10 of 25 , Jun 23, 2013
                      • 0 Attachment
                        ZyX wrote:

                        > > > # HG changeset patch
                        > > > # User ZyX <kp-pav@...>
                        > > > # Date 1371238936 -14400
                        > > > # Fri Jun 14 23:42:16 2013 +0400
                        > > > # Branch python-fixes
                        > > > # Node ID abcf5d9458ee826516c1051cfd14d279b1097174
                        > > > # Parent b9d4dfa09951d4fb75972df34802675edf24a17e
                        > > > Make macros do translation of exception messages
                        > > >
                        > > > Reason: it will be easy to delete/restore translating
                        > >
                        > > Unfortunately this breaks all translations. E.g.:
                        > >
                        > > @@ -120,7 +122,7 @@
                        > > }
                        > > else
                        > > {
                        > > - PyErr_SetString(PyExc_TypeError, _("object must be string"));
                        > > + PyErr_SET_STRING(PyExc_TypeError, "object must be string");
                        > > return NULL;
                        > > }
                        > >
                        > > This string will not be translated. It should have been:
                        > >
                        > > + PyErr_SET_STRING(PyExc_TypeError, N_("object must be string"));
                        > >
                        > > The N_() macro marks a string as translatable.
                        > >
                        > > I'll include this patch now, since otherwise there will be problems with
                        > > all following patches. But please fix this ASAP.
                        >
                        > I do not understand. `_()` was moved into the macros. How is
                        > PyErr_SET_STRING(exc, "message") different from PyErr_SetString(exc,
                        > _("message")) if macros `PyErr_SET_STRING(exc, msg)` is defined to
                        > `PyErr_SetString(exc, _(msg))`?
                        >
                        > If I need to have `N_()` there (in the macros definition) I will write
                        > a patch, but I won't write `PyErr_SET_STRING(exc, N_(msg))`. It is the
                        > very intention: move all _() out of the code to the macros in case I
                        > find some better argument to not ever translate any exception messages
                        > then I have currently.
                        >
                        > ---
                        >
                        > Just tested: translations do work. Steps to reproduce:
                        >
                        > src/vim -u NONE -N -c 'lang ru_RU.UTF-8' -c 'py import vim' -c 'py b=vim.current.buffer' -c 'bw!' -c 'py print b.name' a
                        >
                        > . If this locale is supported it prints "vim.error: попытка сослаться
                        > на уничтоженный буфер" in place of "vim.error: attempt to refer to
                        > deleted buffer".

                        Please follow my instructions. gettext searches the source code for
                        "_()" and "N_()", nothing else. After patch 7.3.1229 existing
                        translations will work, but the next time the translations are updated
                        they will be gone.

                        You can see the effect by running "make ru" in src/po.

                        --
                        A cow comes flying over the battlements, lowing aggressively. The cow
                        lands on GALAHAD'S PAGE, squashing him completely.
                        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                        /// Bram Moolenaar -- Bram@... -- 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 ///

                        --
                        --
                        You received this message from the "vim_dev" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php

                        ---
                        You received this message because you are subscribed to the Google Groups "vim_dev" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • ZyX
                        ... # HG changeset patch # User ZyX # Date 1371991354 -14400 # Sun Jun 23 16:42:34 2013 +0400 # Branch python-fixes # Node ID
                        Message 11 of 25 , Jun 23, 2013
                        • 0 Attachment
                          > Please follow my instructions. gettext searches the source code for
                          > "_()" and "N_()", nothing else. After patch 7.3.1229 existing
                          > translations will work, but the next time the translations are updated
                          > they will be gone.
                          >
                          > You can see the effect by running "make ru" in src/po.

                          # HG changeset patch
                          # User ZyX <kp-pav@...>
                          # Date 1371991354 -14400
                          # Sun Jun 23 16:42:34 2013 +0400
                          # Branch python-fixes
                          # Node ID 3c21dc7cfad1f22855bd64b2a4a79d75cd36b1e3
                          # Parent 8b539b192fd5eae19f61bd3d55a28811ea5bae0c
                          Use N_() to mark strings for translation

                          diff --git a/src/if_py_both.h b/src/if_py_both.h
                          --- a/src/if_py_both.h
                          +++ b/src/if_py_both.h
                          @@ -37,16 +37,17 @@
                          : obj->ob_type->tp_name)

                          #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \
                          - "empty keys are not allowed")
                          -#define RAISE_LOCKED(type) PyErr_SET_VIM(_(type " is locked"))
                          -#define RAISE_LOCKED_DICTIONARY RAISE_LOCKED("dictionary")
                          -#define RAISE_LOCKED_LIST RAISE_LOCKED("list")
                          -#define RAISE_UNDO_FAIL PyErr_SET_VIM("cannot save undo information")
                          -#define RAISE_LINE_FAIL(act) PyErr_SET_VIM("cannot " act " line")
                          + N_("empty keys are not allowed"))
                          +#define RAISE_LOCKED_DICTIONARY PyErr_SET_VIM(N_("dictionary is locked"))
                          +#define RAISE_LOCKED_LIST PyErr_SET_VIM(N_("list is locked"))
                          +#define RAISE_UNDO_FAIL PyErr_SET_VIM(N_("cannot save undo information"))
                          +#define RAISE_DELETE_LINE_FAIL PyErr_SET_VIM(N_("cannot delete line"))
                          +#define RAISE_INSERT_LINE_FAIL PyErr_SET_VIM(N_("cannot insert line"))
                          +#define RAISE_REPLACE_LINE_FAIL PyErr_SET_VIM(N_("cannot replace line"))
                          #define RAISE_KEY_ADD_FAIL(key) \
                          - PyErr_VIM_FORMAT("failed to add key '%s' to dictionary", key)
                          + PyErr_VIM_FORMAT(N_("failed to add key '%s' to dictionary"), key)
                          #define RAISE_INVALID_INDEX_TYPE(idx) \
                          - PyErr_FORMAT(PyExc_TypeError, "index must be int or slice, not %s", \
                          + PyErr_FORMAT(PyExc_TypeError, N_("index must be int or slice, not %s"), \
                          Py_TYPE_NAME(idx));

                          #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
                          @@ -140,9 +141,9 @@
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          #if PY_MAJOR_VERSION < 3
                          - "expected str() or unicode() instance, but got %s"
                          + N_("expected str() or unicode() instance, but got %s")
                          #else
                          - "expected bytes() or str() instance, but got %s"
                          + N_("expected bytes() or str() instance, but got %s")
                          #endif
                          , Py_TYPE_NAME(obj));
                          return NULL;
                          @@ -192,11 +193,11 @@
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          #if PY_MAJOR_VERSION < 3
                          - "expected int(), long() or something supporting "
                          - "coercing to long(), but got %s"
                          + N_("expected int(), long() or something supporting "
                          + "coercing to long(), but got %s")
                          #else
                          - "expected int() or something supporting coercing to int(), "
                          - "but got %s"
                          + N_("expected int() or something supporting coercing to int(), "
                          + "but got %s")
                          #endif
                          , Py_TYPE_NAME(obj));
                          return -1;
                          @@ -207,13 +208,13 @@
                          if (*result > INT_MAX)
                          {
                          PyErr_SET_STRING(PyExc_OverflowError,
                          - "value is too large to fit into C int type");
                          + N_("value is too large to fit into C int type"));
                          return -1;
                          }
                          else if (*result < INT_MIN)
                          {
                          PyErr_SET_STRING(PyExc_OverflowError,
                          - "value is too small to fit into C int type");
                          + N_("value is too small to fit into C int type"));
                          return -1;
                          }
                          }
                          @@ -223,7 +224,7 @@
                          if (*result <= 0)
                          {
                          PyErr_SET_STRING(PyExc_ValueError,
                          - "number must be greater then zero");
                          + N_("number must be greater then zero"));
                          return -1;
                          }
                          }
                          @@ -232,7 +233,7 @@
                          if (*result < 0)
                          {
                          PyErr_SET_STRING(PyExc_ValueError,
                          - "number must be greater or equal to zero");
                          + N_("number must be greater or equal to zero"));
                          return -1;
                          }
                          }
                          @@ -326,7 +327,7 @@
                          if (valObject == NULL)
                          {
                          PyErr_SET_STRING(PyExc_AttributeError,
                          - "can't delete OutputObject attributes");
                          + N_("can't delete OutputObject attributes"));
                          return -1;
                          }

                          @@ -337,7 +338,7 @@
                          return 0;
                          }

                          - PyErr_FORMAT(PyExc_AttributeError, "invalid attribute: %s", name);
                          + PyErr_FORMAT(PyExc_AttributeError, N_("invalid attribute: %s"), name);
                          return -1;
                          }

                          @@ -786,7 +787,7 @@

                          if (our_tv == NULL)
                          {
                          - PyErr_SET_VIM("invalid expression");
                          + PyErr_SET_VIM(N_("invalid expression"));
                          return NULL;
                          }

                          @@ -837,7 +838,7 @@

                          if (our_tv == NULL)
                          {
                          - PyErr_SET_VIM("invalid expression");
                          + PyErr_SET_VIM(N_("invalid expression"));
                          return NULL;
                          }

                          @@ -909,7 +910,7 @@
                          if (VimTryEnd())
                          return NULL;

                          - PyErr_SET_VIM("failed to change directory");
                          + PyErr_SET_VIM(N_("failed to change directory"));
                          return NULL;
                          }

                          @@ -1087,15 +1088,15 @@
                          if (!PyTuple_Check(find_module_result))
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "expected 3-tuple as imp.find_module() result, but got %s",
                          + N_("expected 3-tuple as imp.find_module() result, but got %s"),
                          Py_TYPE_NAME(find_module_result));
                          return NULL;
                          }
                          if (PyTuple_GET_SIZE(find_module_result) != 3)
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "expected 3-tuple as imp.find_module() result, but got "
                          - "tuple of size %d",
                          + N_("expected 3-tuple as imp.find_module() result, but got "
                          + "tuple of size %d"),
                          (int) PyTuple_GET_SIZE(find_module_result));
                          return NULL;
                          }
                          @@ -1105,7 +1106,7 @@
                          || !(description = PyTuple_GET_ITEM(find_module_result, 2)))
                          {
                          PyErr_SET_STRING(PyExc_RuntimeError,
                          - "internal error: imp.find_module returned tuple with NULL");
                          + N_("internal error: imp.find_module returned tuple with NULL"));
                          return NULL;
                          }

                          @@ -1485,7 +1486,7 @@
                          if (valObject == NULL)
                          {
                          PyErr_SET_STRING(PyExc_AttributeError,
                          - "cannot delete vim.Dictionary attributes");
                          + N_("cannot delete vim.Dictionary attributes"));
                          return -1;
                          }

                          @@ -1493,7 +1494,8 @@
                          {
                          if (self->dict->dv_lock == VAR_FIXED)
                          {
                          - PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed dictionary");
                          + PyErr_SET_STRING(PyExc_TypeError,
                          + N_("cannot modify fixed dictionary"));
                          return -1;
                          }
                          else
                          @@ -1510,7 +1512,7 @@
                          }
                          else
                          {
                          - PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name);
                          + PyErr_FORMAT(PyExc_AttributeError, N_("cannot set attribute %s"), name);
                          return -1;
                          }
                          }
                          @@ -1644,7 +1646,7 @@
                          (*dii)->ht->ht_used != (*dii)->ht_used)
                          {
                          PyErr_SET_STRING(PyExc_RuntimeError,
                          - "hashtab changed during iteration");
                          + N_("hashtab changed during iteration"));
                          return NULL;
                          }

                          @@ -1915,8 +1917,8 @@
                          Py_DECREF(iterator);
                          Py_DECREF(fast);
                          PyErr_FORMAT(PyExc_ValueError,
                          - "expected sequence element of size 2, "
                          - "but got sequence of size %d",
                          + N_("expected sequence element of size 2, "
                          + "but got sequence of size %d"),
                          (int) PySequence_Fast_GET_SIZE(fast));
                          return NULL;
                          }
                          @@ -2159,7 +2161,7 @@
                          if (kwargs)
                          {
                          PyErr_SET_STRING(PyExc_TypeError,
                          - "list constructor does not accept keyword arguments");
                          + N_("list constructor does not accept keyword arguments"));
                          return NULL;
                          }

                          @@ -2214,14 +2216,14 @@

                          if (index >= ListLength(self))
                          {
                          - PyErr_SET_STRING(PyExc_IndexError, "list index out of range");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("list index out of range"));
                          return NULL;
                          }
                          li = list_find(self->list, (long) index);
                          if (li == NULL)
                          {
                          /* No more suitable format specifications in python-2.3 */
                          - PyErr_VIM_FORMAT("internal error: failed to get vim list item %d",
                          + PyErr_VIM_FORMAT(N_("internal error: failed to get vim list item %d"),
                          (int) index);
                          return NULL;
                          }
                          @@ -2340,7 +2342,7 @@
                          }
                          if (index > length || (index == length && obj == NULL))
                          {
                          - PyErr_SET_STRING(PyExc_IndexError, "list index out of range");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("list index out of range"));
                          return -1;
                          }

                          @@ -2361,7 +2363,7 @@
                          if (list_append_tv(l, &tv) == FAIL)
                          {
                          clear_tv(&tv);
                          - PyErr_SET_VIM("failed to add item to list");
                          + PyErr_SET_VIM(N_("failed to add item to list"));
                          return -1;
                          }
                          }
                          @@ -2402,7 +2404,8 @@
                          li = list_find(l, (long) first);
                          if (li == NULL)
                          {
                          - PyErr_VIM_FORMAT("internal error: no vim list item %d", (int)first);
                          + PyErr_VIM_FORMAT(N_("internal error: no vim list item %d"),
                          + (int)first);
                          return -1;
                          }
                          if (last > first)
                          @@ -2435,7 +2438,7 @@
                          if (list_insert_tv(l, &v, li) == FAIL)
                          {
                          clear_tv(&v);
                          - PyErr_SET_VIM("internal error: failed to add item to list");
                          + PyErr_SET_VIM(N_("internal error: failed to add item to list"));
                          return -1;
                          }
                          clear_tv(&v);
                          @@ -2491,7 +2494,7 @@
                          if (valObject == NULL)
                          {
                          PyErr_SET_STRING(PyExc_AttributeError,
                          - "cannot delete vim.List attributes");
                          + N_("cannot delete vim.List attributes"));
                          return -1;
                          }

                          @@ -2499,7 +2502,7 @@
                          {
                          if (self->list->lv_lock == VAR_FIXED)
                          {
                          - PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed list");
                          + PyErr_SET_STRING(PyExc_TypeError, N_("cannot modify fixed list"));
                          return -1;
                          }
                          else
                          @@ -2516,7 +2519,7 @@
                          }
                          else
                          {
                          - PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name);
                          + PyErr_FORMAT(PyExc_AttributeError, N_("cannot set attribute %s"), name);
                          return -1;
                          }
                          }
                          @@ -2552,7 +2555,7 @@
                          if (!translated_function_exists(name))
                          {
                          PyErr_FORMAT(PyExc_ValueError,
                          - "unnamed function %s does not exist", name);
                          + N_("unnamed function %s does not exist"), name);
                          return NULL;
                          }
                          self->name = vim_strsave(name);
                          @@ -2563,7 +2566,8 @@
                          vim_strchr(name, AUTOLOAD_CHAR) == NULL))
                          == NULL)
                          {
                          - PyErr_FORMAT(PyExc_ValueError, "function %s does not exist", name);
                          + PyErr_FORMAT(PyExc_ValueError,
                          + N_("function %s does not exist"), name);
                          return NULL;
                          }

                          @@ -2579,7 +2583,7 @@
                          if (kwargs)
                          {
                          PyErr_SET_STRING(PyExc_TypeError,
                          - "function constructor does not accept keyword arguments");
                          + N_("function constructor does not accept keyword arguments"));
                          return NULL;
                          }

                          @@ -2656,7 +2660,7 @@
                          else if (error != OK)
                          {
                          ret = NULL;
                          - PyErr_VIM_FORMAT("failed to run function %s", (char *)name);
                          + PyErr_VIM_FORMAT(N_("failed to run function %s"), (char *)name);
                          }
                          else
                          ret = ConvertToPyObject(&rettv);
                          @@ -2809,13 +2813,13 @@
                          else
                          {
                          PyErr_SET_STRING(PyExc_RuntimeError,
                          - "unable to get option value");
                          + N_("unable to get option value"));
                          return NULL;
                          }
                          }
                          else
                          {
                          - PyErr_SET_VIM("internal error: unknown option type");
                          + PyErr_SET_VIM(N_("internal error: unknown option type"));
                          return NULL;
                          }
                          }
                          @@ -2858,7 +2862,7 @@
                          {
                          if (VimTryEnd())
                          return -1;
                          - PyErr_SET_VIM("problem while switching windows");
                          + PyErr_SET_VIM(N_("problem while switching windows"));
                          return -1;
                          }
                          set_ret = set_option_value_err(key, numval, stringval, opt_flags);
                          @@ -2915,15 +2919,15 @@
                          if (self->opt_type == SREQ_GLOBAL)
                          {
                          PyErr_FORMAT(PyExc_ValueError,
                          - "unable to unset global option %s", key);
                          + N_("unable to unset global option %s"), key);
                          Py_XDECREF(todecref);
                          return -1;
                          }
                          else if (!(flags & SOPT_GLOBAL))
                          {
                          PyErr_FORMAT(PyExc_ValueError,
                          - "unable to unset option %s "
                          - "which does not have global value", key);
                          + N_("unable to unset option %s "
                          + "which does not have global value"), key);
                          Py_XDECREF(todecref);
                          return -1;
                          }
                          @@ -3001,7 +3005,7 @@
                          {
                          if (self->tab == INVALID_TABPAGE_VALUE)
                          {
                          - PyErr_SET_VIM("attempt to refer to deleted tab page");
                          + PyErr_SET_VIM(N_("attempt to refer to deleted tab page"));
                          return -1;
                          }

                          @@ -3145,7 +3149,7 @@
                          if (n == 0)
                          return TabPageNew(tp);

                          - PyErr_SET_STRING(PyExc_IndexError, "no such tab page");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("no such tab page"));
                          return NULL;
                          }

                          @@ -3166,7 +3170,7 @@
                          {
                          if (self->win == INVALID_WINDOW_VALUE)
                          {
                          - PyErr_SET_VIM("attempt to refer to deleted window");
                          + PyErr_SET_VIM(N_("attempt to refer to deleted window"));
                          return -1;
                          }

                          @@ -3332,7 +3336,7 @@

                          if (strcmp(name, "buffer") == 0)
                          {
                          - PyErr_SET_STRING(PyExc_TypeError, "readonly attribute: buffer");
                          + PyErr_SET_STRING(PyExc_TypeError, N_("readonly attribute: buffer"));
                          return -1;
                          }
                          else if (strcmp(name, "cursor") == 0)
                          @@ -3345,7 +3349,7 @@

                          if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count)
                          {
                          - PyErr_SET_VIM("cursor position outside buffer");
                          + PyErr_SET_VIM(N_("cursor position outside buffer"));
                          return -1;
                          }

                          @@ -3508,7 +3512,7 @@
                          if (n == 0)
                          return WindowNew(w, self->tabObject? self->tabObject->tab: curtab);

                          - PyErr_SET_STRING(PyExc_IndexError, "no such window");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("no such window"));
                          return NULL;
                          }

                          @@ -3562,7 +3566,7 @@
                          --len;
                          else
                          {
                          - PyErr_SET_VIM("string cannot contain newlines");
                          + PyErr_SET_VIM(N_("string cannot contain newlines"));
                          Py_XDECREF(bytes);
                          return NULL;
                          }
                          @@ -3700,7 +3704,7 @@
                          if (u_savedel((linenr_T)n, 1L) == FAIL)
                          RAISE_UNDO_FAIL;
                          else if (ml_delete((linenr_T)n, FALSE) == FAIL)
                          - RAISE_LINE_FAIL("delete");
                          + RAISE_DELETE_LINE_FAIL;
                          else
                          {
                          if (buf == savebuf)
                          @@ -3739,7 +3743,7 @@
                          }
                          else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL)
                          {
                          - RAISE_LINE_FAIL("replace");
                          + RAISE_REPLACE_LINE_FAIL;
                          vim_free(save);
                          }
                          else
                          @@ -3806,7 +3810,7 @@
                          {
                          if (ml_delete((linenr_T)lo, FALSE) == FAIL)
                          {
                          - RAISE_LINE_FAIL("delete");
                          + RAISE_DELETE_LINE_FAIL;
                          break;
                          }
                          }
                          @@ -3878,7 +3882,7 @@
                          for (i = 0; i < old_len - new_len; ++i)
                          if (ml_delete((linenr_T)lo, FALSE) == FAIL)
                          {
                          - RAISE_LINE_FAIL("delete");
                          + RAISE_DELETE_LINE_FAIL;
                          break;
                          }
                          extra -= i;
                          @@ -3894,7 +3898,7 @@
                          if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE)
                          == FAIL)
                          {
                          - RAISE_LINE_FAIL("replace");
                          + RAISE_REPLACE_LINE_FAIL;
                          break;
                          }
                          }
                          @@ -3912,7 +3916,7 @@
                          if (ml_append((linenr_T)(lo + i - 1),
                          (char_u *)array[i], 0, FALSE) == FAIL)
                          {
                          - RAISE_LINE_FAIL("insert");
                          + RAISE_INSERT_LINE_FAIL;
                          break;
                          }
                          vim_free(array[i]);
                          @@ -3991,7 +3995,7 @@
                          if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
                          RAISE_UNDO_FAIL;
                          else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
                          - RAISE_LINE_FAIL("insert");
                          + RAISE_INSERT_LINE_FAIL;
                          else
                          appended_lines_mark((linenr_T)n, 1L);

                          @@ -4048,7 +4052,7 @@
                          if (ml_append((linenr_T)(n + i),
                          (char_u *)array[i], 0, FALSE) == FAIL)
                          {
                          - RAISE_LINE_FAIL("insert");
                          + RAISE_INSERT_LINE_FAIL;

                          /* Free the rest of the lines */
                          while (i < size)
                          @@ -4101,7 +4105,7 @@
                          {
                          if (self->buf == INVALID_BUFFER_VALUE)
                          {
                          - PyErr_SET_VIM("attempt to refer to deleted buffer");
                          + PyErr_SET_VIM(N_("attempt to refer to deleted buffer"));
                          return -1;
                          }

                          @@ -4122,7 +4126,7 @@

                          if (n < 0 || n > end - start)
                          {
                          - PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range"));
                          return NULL;
                          }

                          @@ -4178,7 +4182,7 @@

                          if (n < 0 || n > end - start)
                          {
                          - PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range"));
                          return -1;
                          }

                          @@ -4262,7 +4266,7 @@

                          if (n < 0 || n > max)
                          {
                          - PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
                          + PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range"));
                          return NULL;
                          }

                          @@ -4545,7 +4549,7 @@

                          if (ren_ret == FAIL)
                          {
                          - PyErr_SET_VIM("failed to rename buffer");
                          + PyErr_SET_VIM(N_("failed to rename buffer"));
                          return -1;
                          }
                          return 0;
                          @@ -4581,7 +4585,7 @@
                          if (pmark[0] == '\0' || pmark[1] != '\0')
                          {
                          PyErr_SET_STRING(PyExc_ValueError,
                          - "mark name must be a single character");
                          + N_("mark name must be a single character"));
                          Py_XDECREF(todecref);
                          return NULL;
                          }
                          @@ -4599,7 +4603,7 @@

                          if (posp == NULL)
                          {
                          - PyErr_SET_VIM("invalid mark name");
                          + PyErr_SET_VIM(N_("invalid mark name"));
                          return NULL;
                          }

                          @@ -4824,7 +4828,7 @@
                          if (valObject->ob_type != &BufferType)
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "expected vim.Buffer object, but got %s",
                          + N_("expected vim.Buffer object, but got %s"),
                          Py_TYPE_NAME(valObject));
                          return -1;
                          }
                          @@ -4838,7 +4842,7 @@
                          {
                          if (VimTryEnd())
                          return -1;
                          - PyErr_VIM_FORMAT("failed to switch to buffer %d", count);
                          + PyErr_VIM_FORMAT(N_("failed to switch to buffer %d"), count);
                          return -1;
                          }

                          @@ -4851,7 +4855,7 @@
                          if (valObject->ob_type != &WindowType)
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "expected vim.Window object, but got %s",
                          + N_("expected vim.Window object, but got %s"),
                          Py_TYPE_NAME(valObject));
                          return -1;
                          }
                          @@ -4863,7 +4867,7 @@
                          if (!count)
                          {
                          PyErr_SET_STRING(PyExc_ValueError,
                          - "failed to find window in the current tab page");
                          + N_("failed to find window in the current tab page"));
                          return -1;
                          }

                          @@ -4874,7 +4878,7 @@
                          if (VimTryEnd())
                          return -1;
                          PyErr_SET_STRING(PyExc_RuntimeError,
                          - "did not switch to the specified window");
                          + N_("did not switch to the specified window"));
                          return -1;
                          }

                          @@ -4885,7 +4889,7 @@
                          if (valObject->ob_type != &TabPageType)
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "expected vim.TabPage object, but got %s",
                          + N_("expected vim.TabPage object, but got %s"),
                          Py_TYPE_NAME(valObject));
                          return -1;
                          }
                          @@ -4900,7 +4904,7 @@
                          if (VimTryEnd())
                          return -1;
                          PyErr_SET_STRING(PyExc_RuntimeError,
                          - "did not switch to the specified tab page");
                          + N_("did not switch to the specified tab page"));
                          return -1;
                          }

                          @@ -5383,7 +5387,7 @@
                          else
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "unable to convert %s to vim dictionary",
                          + N_("unable to convert %s to vim dictionary"),
                          Py_TYPE_NAME(obj));
                          ret = -1;
                          }
                          @@ -5511,7 +5515,7 @@
                          else
                          {
                          PyErr_FORMAT(PyExc_TypeError,
                          - "unable to convert %s to vim structure",
                          + N_("unable to convert %s to vim structure"),
                          Py_TYPE_NAME(obj));
                          return -1;
                          }
                          @@ -5523,7 +5527,7 @@
                          {
                          if (tv == NULL)
                          {
                          - PyErr_SET_VIM("internal error: NULL reference passed");
                          + PyErr_SET_VIM(N_("internal error: NULL reference passed"));
                          return NULL;
                          }
                          switch (tv->v_type)
                          @@ -5548,7 +5552,7 @@
                          Py_INCREF(Py_None);
                          return Py_None;
                          default:
                          - PyErr_SET_VIM("internal error: invalid value type");
                          + PyErr_SET_VIM(N_("internal error: invalid value type"));
                          return NULL;
                          }
                          }

                          --
                          --
                          You received this message from the "vim_dev" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php

                          ---
                          You received this message because you are subscribed to the Google Groups "vim_dev" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                        • Bram Moolenaar
                          ... After including this patch test 86 and 87 fail. Test 87 has only a ... +++ testdir/test87.ok 2013-06-23 14:43:28.000000000 +0200 @@ -1175,6 +1175,9 @@
                          Message 12 of 25 , Jun 23, 2013
                          • 0 Attachment
                            ZyX wrote:

                            > Wrong patch. Correct one:
                            >
                            > # HG changeset patch
                            > # User ZyX <kp-pav@...>
                            > # Date 1371441247 -14400
                            > # Mon Jun 17 07:54:07 2013 +0400
                            > # Branch python-fixes
                            > # Node ID 42e166b5c6ff07cd7810780b1d3704b8ce61bac0
                            > # Parent 4a00cd941a883917f6d740f9f06aca7baadcb45e
                            > Add NUMBER_UNSIGNED to WindowSetattr(, "width"|"height")
                            > And more tests
                            >
                            > Note: in ee('import failing') it was expected to raise NotImplementedError, but
                            > actually raises ImportError

                            After including this patch test 86 and 87 fail. Test 87 has only a
                            small diff:

                            --- testdir/test87.failed 2013-06-23 14:45:47.000000000 +0200
                            +++ testdir/test87.ok 2013-06-23 14:43:28.000000000 +0200
                            @@ -1175,6 +1175,9 @@
                            3,xx
                            before
                            after
                            +pythonx/topmodule/__init__.py
                            +pythonx/topmodule/submodule/__init__.py
                            +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                            vim.command("throw 'abcN'"):(<class 'vim.error'>, error('abcN',))
                            Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
                            vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))


                            Test 86 has very many differences. Here are a few typical examples:

                            --- testdir/test86.failed 2013-06-23 14:44:51.000000000 +0200
                            +++ testdir/test86.ok 2013-06-23 14:43:28.000000000 +0200
                            @@ -550,7 +550,7 @@
                            d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
                            d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:()
                            d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:()
                            -d["a"] = {"abcF" : FailingNumber()}:TypeError:("long() argument must be a string or a number, not 'FailingNumber'",)
                            +d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',)
                            <<< Finished
                            >>> Testing StringToChars using d["a"] = Mapping({%s : 1})
                            d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',)


                            @@ -652,7 +652,7 @@
                            d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
                            d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:()
                            d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:()
                            -d.update(Mapping({"abcG" : FailingNumber()})):TypeError:("long() argument must be a string or a number, not 'FailingNumber'",)
                            +d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',)
                            <<< Finished
                            >>> Testing *Iter* using d.update(%s)
                            d.update(FailingIter()):NotImplementedError:()


                            @@ -824,11 +824,371 @@
                            ll[1:100] = "abcJ":error:('list is locked',)
                            >>> Testing *Iter* using l[:] = %s
                            l[:] = FailingIter():NotImplementedError:()
                            +l[:] = FailingIterNext():NotImplementedError:()
                            +<<< Finished
                            +>>> Testing StringToChars using l[:] = [{%s : 1}]
                            +l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',)
                            +l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',)
                            +l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',)
                            +<<< Finished
                            +>>> Testing StringToChars using l[:] = [{"abcF" : {%s : 1}}]
                            +l[:] = [{"abcF" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',)
                            +l[:] = [{"abcF" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',)
                            +l[:] = [{"abcF" : {"\0" : 1}}]:TypeError:('expected string without null bytes',)
                            [...]


                            I suspect following patches won't apply cleanly without this one, thus I
                            will stop here. Please start a new sequence of patches against
                            7.3.1233.

                            --
                            ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away!
                            Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd
                            cow or goose hitting them still. The KNIGHTS crouch down under cover.
                            "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                            /// Bram Moolenaar -- Bram@... -- 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 ///

                            --
                            --
                            You received this message from the "vim_dev" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php

                            ---
                            You received this message because you are subscribed to the Google Groups "vim_dev" group.
                            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                          • ZyX
                            The tests are fixed in next patch. To make them work with the patch you refer to you have to run tests with python-2.3. -- -- You received this message from
                            Message 13 of 25 , Jun 23, 2013
                            • 0 Attachment
                              The tests are fixed in next patch. To make them work with the patch you refer to you have to run tests with python-2.3.

                              --
                              --
                              You received this message from the "vim_dev" maillist.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php

                              ---
                              You received this message because you are subscribed to the Google Groups "vim_dev" group.
                              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                              For more options, visit https://groups.google.com/groups/opt_out.
                            • ZyX
                              ... This should be fixed with the following diff. Though with hg export --git (“fixed” version of the patch) it should not be necessary as empty files do
                              Message 14 of 25 , Jun 23, 2013
                              • 0 Attachment
                                > --- testdir/test87.failed 2013-06-23 14:45:47.000000000 +0200
                                > +++ testdir/test87.ok 2013-06-23 14:43:28.000000000 +0200
                                > @@ -1175,6 +1175,9 @@
                                > 3,xx
                                > before
                                > after
                                > +pythonx/topmodule/__init__.py
                                > +pythonx/topmodule/submodule/__init__.py
                                > +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                                > vim.command("throw 'abcN'"):(<class 'vim.error'>, error('abcN',))
                                > Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
                                > vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))


                                This should be fixed with the following diff. Though with hg export --git (“fixed” version of the patch) it should not be necessary as empty files do appear in its output.

                                # HG changeset patch
                                # User ZyX <kp-pav@...>
                                # Date 1371993246 -14400
                                # Sun Jun 23 17:14:06 2013 +0400
                                # Branch python-fixes
                                # Node ID bec8c9e957010b4a87424de12456d7e98df8776c
                                # Parent 3c21dc7cfad1f22855bd64b2a4a79d75cd36b1e3
                                Use 2-bytes files with a comment in place of empty files

                                diff --git a/src/testdir/pythonx/topmodule/__init__.py b/src/testdir/pythonx/topmodule/__init__.py
                                --- a/src/testdir/pythonx/topmodule/__init__.py
                                +++ b/src/testdir/pythonx/topmodule/__init__.py
                                @@ -0,0 +1,1 @@
                                +#
                                diff --git a/src/testdir/pythonx/topmodule/submodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/__init__.py
                                --- a/src/testdir/pythonx/topmodule/submodule/__init__.py
                                +++ b/src/testdir/pythonx/topmodule/submodule/__init__.py
                                @@ -0,0 +1,1 @@
                                +#
                                diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py
                                --- a/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py
                                +++ b/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py
                                @@ -0,0 +1,1 @@
                                +#
                                diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                                --- a/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                                +++ b/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                                @@ -0,0 +1,1 @@
                                +#

                                --
                                --
                                You received this message from the "vim_dev" maillist.
                                Do not top-post! Type your reply below the text you are replying to.
                                For more information, visit http://www.vim.org/maillist.php

                                ---
                                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                For more options, visit https://groups.google.com/groups/opt_out.
                              • Bram Moolenaar
                                ... Thanks for the quick fix. -- A KNIGHT rides into shot and hacks him to the ground. He rides off. We stay for a moment on the glade. A MIDDLE-AGED LADY in
                                Message 15 of 25 , Jun 23, 2013
                                • 0 Attachment
                                  ZyX wrote:

                                  > > Please follow my instructions. gettext searches the source code for
                                  > > "_()" and "N_()", nothing else. After patch 7.3.1229 existing
                                  > > translations will work, but the next time the translations are updated
                                  > > they will be gone.
                                  > >
                                  > > You can see the effect by running "make ru" in src/po.
                                  >
                                  > # HG changeset patch
                                  > # User ZyX <kp-pav@...>
                                  > # Date 1371991354 -14400
                                  > # Sun Jun 23 16:42:34 2013 +0400
                                  > # Branch python-fixes
                                  > # Node ID 3c21dc7cfad1f22855bd64b2a4a79d75cd36b1e3
                                  > # Parent 8b539b192fd5eae19f61bd3d55a28811ea5bae0c
                                  > Use N_() to mark strings for translation

                                  Thanks for the quick fix.

                                  --
                                  A KNIGHT rides into shot and hacks him to the ground. He rides off.
                                  We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A.
                                  twin-set emerges from the trees and looks in horror at the body of her
                                  HUSBAND.
                                  MRS HISTORIAN: FRANK!
                                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                  /// Bram Moolenaar -- Bram@... -- 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 ///

                                  --
                                  --
                                  You received this message from the "vim_dev" maillist.
                                  Do not top-post! Type your reply below the text you are replying to.
                                  For more information, visit http://www.vim.org/maillist.php

                                  ---
                                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                  For more options, visit https://groups.google.com/groups/opt_out.
                                • Bram Moolenaar
                                  ... Thanks. When I apply both patches 9 and 10 , plus this one then the tests are passing. I ll send this out as one big patch. -- press CTRL-ALT-DEL for
                                  Message 16 of 25 , Jun 23, 2013
                                  • 0 Attachment
                                    ZyX wrote:

                                    > > --- testdir/test87.failed 2013-06-23 14:45:47.000000000 +0200
                                    > > +++ testdir/test87.ok 2013-06-23 14:43:28.000000000 +0200
                                    > > @@ -1175,6 +1175,9 @@
                                    > > 3,xx
                                    > > before
                                    > > after
                                    > > +pythonx/topmodule/__init__.py
                                    > > +pythonx/topmodule/submodule/__init__.py
                                    > > +pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
                                    > > vim.command("throw 'abcN'"):(<class 'vim.error'>, error('abcN',))
                                    > > Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
                                    > > vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
                                    >
                                    >
                                    > This should be fixed with the following diff. Though with hg export
                                    > --git (“fixed” version of the patch) it should not be necessary as
                                    > empty files do appear in its output.

                                    Thanks. When I apply both patches "9" and "10", plus this one then the
                                    tests are passing. I'll send this out as one big patch.

                                    --
                                    press CTRL-ALT-DEL for more information

                                    /// Bram Moolenaar -- Bram@... -- 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 ///

                                    --
                                    --
                                    You received this message from the "vim_dev" maillist.
                                    Do not top-post! Type your reply below the text you are replying to.
                                    For more information, visit http://www.vim.org/maillist.php

                                    ---
                                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                    For more options, visit https://groups.google.com/groups/opt_out.
                                  • ZyX
                                    After make ru I find many incorrect fuzzy-matched translations in src/po/ru.po. Am not sure whether the following is the right fix though. # HG changeset
                                    Message 17 of 25 , Jun 23, 2013
                                    • 0 Attachment
                                      After "make ru" I find many incorrect fuzzy-matched translations in src/po/ru.po. Am not sure whether the following is the right fix though.

                                      # HG changeset patch
                                      # User ZyX <kp-pav@...>
                                      # Date 1371999908 -14400
                                      # Sun Jun 23 19:05:08 2013 +0400
                                      # Branch python-fixes
                                      # Node ID 6d47c9fe0c735245337578a76d3ece1c5a4a1b52
                                      # Parent bec8c9e957010b4a87424de12456d7e98df8776c
                                      Translation update: replace fuzzy-matched strings found after `make ru` with proper ones

                                      diff --git a/src/po/ru.po b/src/po/ru.po
                                      --- a/src/po/ru.po
                                      +++ b/src/po/ru.po
                                      @@ -6573,110 +6573,126 @@
                                      msgid "Need encryption key for \"%s\""
                                      msgstr "Требуется ключ шифрования для \"%s\""

                                      +msgid "empty keys are not allowed"
                                      +msgstr "пустые ключи не допустимы"
                                      +
                                      +msgid "dictionary is locked"
                                      +msgstr "словарь заблокирован"
                                      +
                                      +msgid "list is locked"
                                      +msgstr "список заблокирован"
                                      +
                                      +#, c-format
                                      +msgid "failed to add key '%s' to dictionary"
                                      +msgstr "не удалось добавить ключ <<%s>> к словарю"
                                      +
                                      msgid "can't delete OutputObject attributes"
                                      msgstr "невозможно удалить атрибуты OutputObject"

                                      -msgid "softspace must be an integer"
                                      -msgstr "значение softspace должно быть целым числом"
                                      -
                                      -msgid "invalid attribute"
                                      -msgstr "неправильный атрибут"
                                      -
                                      -msgid "writelines() requires list of strings"
                                      -msgstr "writelines() требует указания списка строк"
                                      +#, c-format
                                      +msgid "invalid attribute: %s"
                                      +msgstr "неправильный атрибут: %s"

                                      msgid "E264: Python: Error initialising I/O objects"
                                      msgstr "E264: Python: Ошибка инициализации объектов I/O"

                                      -msgid "no such buffer"
                                      -msgstr "нет такого буфера"
                                      -
                                      -msgid "empty keys are not allowed"
                                      -msgstr "пустые ключи не допустимы"
                                      -
                                      -msgid "failed to add key to dictionary"
                                      -msgstr "невозможно добавить ключ к словарю"
                                      -
                                      -msgid "Cannot delete DictionaryObject attributes"
                                      -msgstr "Невозможно удалить атрибуты DictionaryObject"
                                      -
                                      -msgid "Cannot modify fixed dictionary"
                                      -msgstr "Невозможно изменить фиксированный словарь"
                                      -
                                      -msgid "Only boolean objects are allowed"
                                      -msgstr "Разрешено использовать только логические объекты"
                                      -
                                      -msgid "Cannot set this attribute"
                                      -msgstr "Невозможно установить этот атрибут"
                                      -
                                      -msgid "no such key in dictionary"
                                      -msgstr "нет такого ключа в словаре"
                                      -
                                      -msgid "dict is locked"
                                      -msgstr "словарь заблокирован"
                                      -
                                      -msgid "internal error: failed to get vim list item"
                                      -msgstr "внутренняя ошибка: не удалось получить элемент списка VIM"
                                      -
                                      -msgid "list is locked"
                                      -msgstr "список заблокирован"
                                      -
                                      -msgid "Failed to add item to list"
                                      -msgstr "Невозможно добавить элемент в список"
                                      -
                                      -msgid "internal error: no vim list item"
                                      -msgstr "внутренняя ошибка: нет элемента списка VIM"
                                      -
                                      -msgid "can only assign lists to slice"
                                      -msgstr "назначение выборки возможно только для списков"
                                      +msgid "failed to change directory"
                                      +msgstr "не удалось изменить текущий каталог"
                                      +
                                      +msgid "cannot delete vim.Dictionary attributes"
                                      +msgstr "невозможно удалить атрибуты vim.Dictionary"
                                      +
                                      +msgid "cannot modify fixed dictionary"
                                      +msgstr "невозможно изменить фиксированный словарь"
                                      +
                                      +#, c-format
                                      +msgid "cannot set attribute %s"
                                      +msgstr "невозможно установить аттрибут %s"
                                      +
                                      +msgid "list index out of range"
                                      +msgstr "номер элемента за пределами диапазона"
                                      +
                                      +#, c-format
                                      +msgid "internal error: failed to get vim list item %d"
                                      +msgstr "внутренняя ошибка: не удалось получить элемент %d списка VIM"
                                      +
                                      +msgid "failed to add item to list"
                                      +msgstr "не удалось добавить элемент в список"
                                      +
                                      +#, c-format
                                      +msgid "internal error: no vim list item %d"
                                      +msgstr "внутренняя ошибка: нет элемента %d списка VIM"

                                      msgid "internal error: failed to add item to list"
                                      msgstr "внутренняя ошибка: не удалось добавить элемент в список"

                                      -msgid "can only concatenate with lists"
                                      -msgstr "можно объединить только списки"
                                      -
                                      -msgid "Cannot modify fixed list"
                                      -msgstr "Невозможно изменить фиксированный список"
                                      -
                                      -msgid "'self' argument must be a dictionary"
                                      -msgstr "параметр 'self' должен быть словарём"
                                      -
                                      -msgid "failed to run function"
                                      -msgstr "невозможно выполнить функцию"
                                      +msgid "cannot delete vim.List attributes"
                                      +msgstr "невозможно удалить атрибуты vim.List"
                                      +
                                      +msgid "cannot modify fixed list"
                                      +msgstr "невозможно изменить фиксированный список"
                                      +
                                      +#, c-format
                                      +msgid "unnamed function %s does not exist"
                                      +msgstr "анонимная функция %s не существует"
                                      +
                                      +#, c-format
                                      +msgid "function %s does not exist"
                                      +msgstr "функция %s не существует"
                                      +
                                      +#, c-format
                                      +msgid "failed to run function %s"
                                      +msgstr "не удалось выполнить функцию %s"
                                      +
                                      +msgid "unable to get option value"
                                      +msgstr "не удалось получить значение настройки"
                                      +
                                      +msgid "internal error: unknown option type"
                                      +msgstr "внутренняя ошибка: неизвестный тип настройки"
                                      +
                                      +msgid "attempt to refer to deleted tab page"
                                      +msgstr "попытка сослаться на уничтоженную вкладку"
                                      +
                                      +msgid "no such tab page"
                                      +msgstr "нет такой вкладки"

                                      msgid "attempt to refer to deleted window"
                                      msgstr "попытка сослаться на закрытое окно"

                                      -msgid "readonly attribute"
                                      -msgstr "атрибут доступен только для чтения"
                                      +msgid "readonly attribute: buffer"
                                      +msgstr "атрибут buffer доступен только для чтения"

                                      msgid "cursor position outside buffer"
                                      msgstr "позиция курсора находится вне буфера"

                                      -#, c-format
                                      -msgid "<window object (deleted) at %p>"
                                      -msgstr "<объект окна (удален) в %p>"
                                      -
                                      -#, c-format
                                      -msgid "<window object (unknown) at %p>"
                                      -msgstr "<объект окна (неизвестен) в %p>"
                                      -
                                      -#, c-format
                                      -msgid "<window %d>"
                                      -msgstr "<окно %d>"
                                      -
                                      msgid "no such window"
                                      msgstr "нет такого окна"

                                      msgid "attempt to refer to deleted buffer"
                                      msgstr "попытка сослаться на уничтоженный буфер"

                                      -msgid "unable to convert to vim structure"
                                      -msgstr "невозможно преобразовать в структуру VIM"
                                      -
                                      -msgid "NULL reference passed"
                                      -msgstr "передана ссылка на NULL"
                                      +msgid "failed to rename buffer"
                                      +msgstr "не удалось переименовать буфер"
                                      +
                                      +msgid "failed to run the code"
                                      +msgstr "невозможно выполнить функцию"
                                      +
                                      +msgid "E858: Eval did not return a valid python object"
                                      +msgstr "E858: Eval не возвратил допустимого объекта Python"
                                      +
                                      +msgid "E859: Failed to convert returned python object to vim value"
                                      +msgstr "E859: Не удалось преобразовать возвращённый объект Python в значение VIM"
                                      +
                                      +#, c-format
                                      +msgid "unable to convert %s to vim dictionary"
                                      +msgstr "невозможно преобразовать %s в словарь Vim"
                                      +
                                      +#, c-format
                                      +msgid "unable to convert %s to vim structure"
                                      +msgstr "невозможно преобразовать %s в структуру Vim"
                                      +
                                      +msgid "internal error: NULL reference passed"
                                      +msgstr "внутренняя ошибка: передана ссылка на NULL"

                                      msgid "internal error: invalid value type"
                                      msgstr "внутренняя ошибка: неправильный тип значения"

                                      --
                                      --
                                      You received this message from the "vim_dev" maillist.
                                      Do not top-post! Type your reply below the text you are replying to.
                                      For more information, visit http://www.vim.org/maillist.php

                                      ---
                                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                      For more options, visit https://groups.google.com/groups/opt_out.
                                    • Bram Moolenaar
                                      ... Sergey Alyoshin was maintaining the Russian translations. Sergey, are you OK with including this? -- He was not in the least bit scared to be mashed into a
                                      Message 18 of 25 , Jun 23, 2013
                                      • 0 Attachment
                                        ZyX wrote:

                                        > After "make ru" I find many incorrect fuzzy-matched translations in
                                        > src/po/ru.po. Am not sure whether the following is the right fix
                                        > though.
                                        >
                                        > # HG changeset patch
                                        > # User ZyX <kp-pav@...>
                                        > # Date 1371999908 -14400
                                        > # Sun Jun 23 19:05:08 2013 +0400
                                        > # Branch python-fixes
                                        > # Node ID 6d47c9fe0c735245337578a76d3ece1c5a4a1b52
                                        > # Parent bec8c9e957010b4a87424de12456d7e98df8776c
                                        > Translation update: replace fuzzy-matched strings found after `make
                                        > ru` with proper ones

                                        Sergey Alyoshin was maintaining the Russian translations.

                                        Sergey, are you OK with including this?

                                        --
                                        He was not in the least bit scared to be mashed into a pulp
                                        Or to have his eyes gouged out and his elbows broken;
                                        To have his kneecaps split and his body burned away
                                        And his limbs all hacked and mangled, brave Sir Robin.
                                        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                        /// Bram Moolenaar -- Bram@... -- 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 ///

                                        --
                                        --
                                        You received this message from the "vim_dev" maillist.
                                        Do not top-post! Type your reply below the text you are replying to.
                                        For more information, visit http://www.vim.org/maillist.php

                                        ---
                                        You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                        For more options, visit https://groups.google.com/groups/opt_out.
                                      Your message has been successfully submitted and would be delivered to recipients shortly.