# HG changeset patch # User Bram Moolenaar # Date 1370192061 -7200 # Node ID bf917ee1fad22f643d7ef1a919b233f07fc1fb3c # Parent df6e3b069a8db24c5691b40895962123fb99b29f updated for version 7.3.1100 Problem: Python: a few more memory problems. Solution: Add and remove Py_XDECREF(). (ZyX) 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 @@ -1236,6 +1236,7 @@ DictionaryAssItem(DictionaryObject *self if (*key == NUL) { RAISE_NO_EMPTY_KEYS; + Py_XDECREF(todecref); return -1; } @@ -1254,11 +1255,15 @@ DictionaryAssItem(DictionaryObject *self hi = hash_find(&dict->dv_hashtab, di->di_key); hash_remove(&dict->dv_hashtab, hi); dictitem_free(di); + Py_XDECREF(todecref); return 0; } if (ConvertFromPyObject(valObject, &tv) == -1) + { + Py_XDECREF(todecref); return -1; + } if (di == NULL) { @@ -2505,11 +2510,8 @@ OptionsAssItem(OptionsObject *self, PyOb PyObject *todecref; if ((val = StringToChars(valObject, &todecref))) - { r = set_option_value_for(key, 0, val, opt_flags, self->opt_type, self->from); - Py_XDECREF(todecref); - } else r = -1; } diff --git a/src/testdir/test86.in b/src/testdir/test86.in --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -867,6 +867,7 @@ def convertfrompyobject_test(expr, recur return subexpr_test(expr, 'ConvertFromPyObject', ( 'None', # Not conversible '{"": 1}', # Empty key not allowed + '{u"": 1}', # Same, but with unicode object 'FailingMapping()', # 'FailingMappingKey()', # )) diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -503,6 +503,7 @@ d["a"] = {"abc" : FailingIterNext()}:(>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} d["a"] = {"abc" : None}:(, TypeError('unable to convert 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()) <<< Finished @@ -528,6 +529,7 @@ d["a"] = Mapping({"abc" : FailingIterNex >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert 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()) <<< Finished @@ -538,6 +540,7 @@ d["a"] = FailingIterNext():(>> Testing ConvertFromPyObject using d["a"] = %s d["a"] = None:(, TypeError('unable to convert 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()) <<< Finished @@ -568,6 +571,7 @@ d.update({"abc" : FailingIterNext()}):(< >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) d.update({"abc" : None}):(, TypeError('unable to convert 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()) <<< Finished @@ -593,6 +597,7 @@ d.update(Mapping({"abc" : FailingIterNex >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) d.update(Mapping({"abc" : None})):(, TypeError('unable to convert 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()) <<< Finished @@ -603,6 +608,7 @@ d.update(FailingIterNext()):(>> 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()) <<< Finished @@ -633,6 +639,7 @@ d.update((("a", {"abc" : FailingIterNext >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert 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()) <<< Finished @@ -658,6 +665,7 @@ d.update((("a", Mapping({"abc" : Failing >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert 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()) <<< Finished @@ -668,6 +676,7 @@ d.update((("a", FailingIterNext()),)):(< >>> Testing ConvertFromPyObject using d.update((("a", %s),)) d.update((("a", None),)):(, TypeError('unable to convert 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()) <<< Finished @@ -701,6 +710,7 @@ vim.List([{"abc" : FailingIterNext()}]): >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) vim.List([{"abc" : None}]):(, TypeError('unable to convert 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()) <<< Finished @@ -726,6 +736,7 @@ vim.List([Mapping({"abc" : FailingIterNe >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert 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()) <<< Finished @@ -736,6 +747,7 @@ vim.List([FailingIterNext()]):(>> Testing ConvertFromPyObject using vim.List([%s]) vim.List([None]):(, TypeError('unable to convert 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()) <<< Finished @@ -768,6 +780,7 @@ l[:] = [{"abc" : FailingIterNext()}]:(>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] l[:] = [{"abc" : None}]:(, TypeError('unable to convert 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()) <<< Finished @@ -793,6 +806,7 @@ l[:] = [Mapping({"abc" : FailingIterNext >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert 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()) <<< Finished @@ -803,6 +817,7 @@ l[:] = [FailingIterNext()]:(>> Testing ConvertFromPyObject using l[:] = [%s] l[:] = [None]:(, TypeError('unable to convert 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()) <<< Finished @@ -829,6 +844,7 @@ l.extend([{"abc" : FailingIterNext()}]): >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) l.extend([{"abc" : None}]):(, TypeError('unable to convert 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()) <<< Finished @@ -854,6 +870,7 @@ l.extend([Mapping({"abc" : FailingIterNe >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert 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()) <<< Finished @@ -864,6 +881,7 @@ l.extend([FailingIterNext()]):(>> Testing ConvertFromPyObject using l.extend([%s]) l.extend([None]):(, TypeError('unable to convert 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()) <<< Finished @@ -899,6 +917,7 @@ f({"abc" : FailingIterNext()}):(>> Testing ConvertFromPyObject using f({"abc" : %s}) f({"abc" : None}):(, TypeError('unable to convert 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()) <<< Finished @@ -924,6 +943,7 @@ f(Mapping({"abc" : FailingIterNext()})): >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) f(Mapping({"abc" : None})):(, TypeError('unable to convert 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()) <<< Finished @@ -934,6 +954,7 @@ f(FailingIterNext()):(>> Testing ConvertFromPyObject using f(%s) f(None):(, TypeError('unable to convert 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()) <<< Finished @@ -959,6 +980,7 @@ fd(self={"abc" : FailingIterNext()}):(>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +fd(self={"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) <<< Finished @@ -984,6 +1006,7 @@ fd(self=Mapping({"abc" : FailingIterNext >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +fd(self=Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) <<< Finished @@ -994,6 +1017,7 @@ fd(self=FailingIterNext()):(>> Testing ConvertFromPyObject using fd(self=%s) fd(self=None):(, TypeError('unable to convert object 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()) <<< Finished diff --git a/src/testdir/test87.in b/src/testdir/test87.in --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -833,7 +833,8 @@ def convertfrompyobject_test(expr, recur iter_test(expr) return subexpr_test(expr, 'ConvertFromPyObject', ( 'None', # Not conversible - '{"": 1}', # Empty key not allowed + '{b"": 1}', # Empty key not allowed + '{"": 1}', # Same, but with unicode object 'FailingMapping()', # 'FailingMappingKey()', # )) diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -495,6 +495,7 @@ d["a"] = {"abc" : FailingIterNext()}:(>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) +d["a"] = {"abc" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) @@ -520,6 +521,7 @@ d["a"] = Mapping({"abc" : FailingIterNex <<< Finished >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +d["a"] = Mapping({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) @@ -530,6 +532,7 @@ d["a"] = FailingIterNext():(>> Testing ConvertFromPyObject using d["a"] = %s d["a"] = None:(, TypeError('unable to convert to vim structure',)) +d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) d["a"] = FailingMapping():(, NotImplementedError()) d["a"] = FailingMappingKey():(, NotImplementedError()) @@ -564,6 +567,7 @@ d.update({"abc" : FailingIterNext()}):(< <<< Finished >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +d.update({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) d.update({"abc" : FailingMapping()}):(, NotImplementedError()) d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) @@ -589,6 +593,7 @@ d.update(Mapping({"abc" : FailingIterNex <<< Finished >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +d.update(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) @@ -599,6 +604,7 @@ d.update(FailingIterNext()):(>> Testing ConvertFromPyObject using d.update(%s) d.update(None):(, TypeError("'NoneType' object is not iterable",)) +d.update({b"": 1}):(, ValueError('empty keys are not allowed',)) d.update({"": 1}):(, ValueError('empty keys are not allowed',)) d.update(FailingMapping()):(, NotImplementedError()) d.update(FailingMappingKey()):(, NotImplementedError()) @@ -629,6 +635,7 @@ d.update((("a", {"abc" : FailingIterNext <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) +d.update((("a", {"abc" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) @@ -654,6 +661,7 @@ d.update((("a", Mapping({"abc" : Failing <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) +d.update((("a", Mapping({"abc" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) @@ -664,6 +672,7 @@ d.update((("a", FailingIterNext()),)):(< <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", %s),)) d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) +d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) d.update((("a", FailingMapping()),)):(, NotImplementedError()) d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) @@ -701,6 +710,7 @@ vim.List([{"abc" : FailingIterNext()}]): <<< Finished >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +vim.List([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) @@ -726,6 +736,7 @@ vim.List([Mapping({"abc" : FailingIterNe <<< Finished >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +vim.List([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) @@ -736,6 +747,7 @@ vim.List([FailingIterNext()]):(>> Testing ConvertFromPyObject using vim.List([%s]) vim.List([None]):(, TypeError('unable to convert to vim structure',)) +vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) vim.List([FailingMapping()]):(, NotImplementedError()) vim.List([FailingMappingKey()]):(, NotImplementedError()) @@ -772,6 +784,7 @@ l[:] = [{"abc" : FailingIterNext()}]:(>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) +l[:] = [{"abc" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) @@ -797,6 +810,7 @@ l[:] = [Mapping({"abc" : FailingIterNext <<< Finished >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) +l[:] = [Mapping({"abc" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) @@ -807,6 +821,7 @@ l[:] = [FailingIterNext()]:(>> Testing ConvertFromPyObject using l[:] = [%s] l[:] = [None]:(, TypeError('unable to convert to vim structure',)) +l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) l[:] = [FailingMapping()]:(, NotImplementedError()) l[:] = [FailingMappingKey()]:(, NotImplementedError()) @@ -837,6 +852,7 @@ l.extend([{"abc" : FailingIterNext()}]): <<< Finished >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +l.extend([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) @@ -862,6 +878,7 @@ l.extend([Mapping({"abc" : FailingIterNe <<< Finished >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +l.extend([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) @@ -872,6 +889,7 @@ l.extend([FailingIterNext()]):(>> Testing ConvertFromPyObject using l.extend([%s]) l.extend([None]):(, TypeError('unable to convert to vim structure',)) +l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) l.extend([FailingMapping()]):(, NotImplementedError()) l.extend([FailingMappingKey()]):(, NotImplementedError()) @@ -907,6 +925,7 @@ f({"abc" : FailingIterNext()}):(>> Testing ConvertFromPyObject using f({"abc" : %s}) f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +f({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) f({"abc" : FailingMapping()}):(, NotImplementedError()) f({"abc" : FailingMappingKey()}):(, NotImplementedError()) @@ -932,6 +951,7 @@ f(Mapping({"abc" : FailingIterNext()})): <<< Finished >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +f(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) @@ -942,6 +962,7 @@ f(FailingIterNext()):(>> Testing ConvertFromPyObject using f(%s) f(None):(, TypeError('unable to convert to vim structure',)) +f({b"": 1}):(, ValueError('empty keys are not allowed',)) f({"": 1}):(, ValueError('empty keys are not allowed',)) f(FailingMapping()):(, NotImplementedError()) f(FailingMappingKey()):(, NotImplementedError()) @@ -967,6 +988,7 @@ fd(self={"abc" : FailingIterNext()}):(>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) +fd(self={"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) @@ -992,6 +1014,7 @@ fd(self=Mapping({"abc" : FailingIterNext <<< Finished >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +fd(self=Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) @@ -1002,6 +1025,7 @@ fd(self=FailingIterNext()):(>> Testing ConvertFromPyObject using fd(self=%s) fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) +fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) fd(self=FailingMapping()):(, NotImplementedError()) fd(self=FailingMappingKey()):(, NotImplementedError()) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1100, +/**/ 1099, /**/ 1098,