# HG changeset patch
# User ZyX <[email protected]>
# Date 1369942742 -14400
# Branch python-extended-4
# Node ID 91666dd3057c5ffc5c212316163eaedfe1e4943a
# Parent 969d365e3905ef96abdda7ba4fb43fd5bf45ae36
Fix some possible memory problems
diff -r 969d365e3905 -r 91666dd3057c src/if_py_both.h
--- a/src/if_py_both.h Thu May 30 23:00:46 2013 +0400
+++ b/src/if_py_both.h Thu May 30 23:39:02 2013 +0400
@@ -1174,6 +1174,7 @@
if (*key == NUL)
{
RAISE_NO_EMPTY_KEYS;
+ Py_XDECREF(todecref);
return -1;
}
@@ -1192,11 +1193,15 @@
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)
{
@@ -2416,11 +2421,8 @@
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 -r 969d365e3905 -r 91666dd3057c src/testdir/test86.in
--- a/src/testdir/test86.in Thu May 30 23:00:46 2013 +0400
+++ b/src/testdir/test86.in Thu May 30 23:39:02 2013 +0400
@@ -851,6 +851,7 @@
return subexpr_test(expr, 'ConvertFromPyObject', (
'None', # Not conversible
'{"": 1}', # Empty key not allowed
+ '{u"": 1}', # Same, but with unicode object
'FailingMapping()', #
'FailingMappingKey()', #
))
diff -r 969d365e3905 -r 91666dd3057c src/testdir/test86.ok
--- a/src/testdir/test86.ok Thu May 30 23:00:46 2013 +0400
+++ b/src/testdir/test86.ok Thu May 30 23:39:02 2013 +0400
@@ -501,6 +501,7 @@
>>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s}
d["a"] = {"abc" : None}:(<type 'exceptions.TypeError'>, TypeError('unable to
convert to vim structure',))
d["a"] = {"abc" : {"": 1}}:(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
+d["a"] = {"abc" : {u"": 1}}:(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
d["a"] = {"abc" : FailingMapping()}:(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
d["a"] = {"abc" : FailingMappingKey()}:(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -526,6 +527,7 @@
>>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : None}):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
d["a"] = Mapping({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+d["a"] = Mapping({"abc" : {u"": 1}}):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
d["a"] = Mapping({"abc" : FailingMapping()}):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
d["a"] = Mapping({"abc" : FailingMappingKey()}):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -536,6 +538,7 @@
>>> Testing ConvertFromPyObject using d["a"] = %s
d["a"] = None:(<type 'exceptions.TypeError'>, TypeError('unable to convert to
vim structure',))
d["a"] = {"": 1}:(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
+d["a"] = {u"": 1}:(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
d["a"] = FailingMapping():(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
d["a"] = FailingMappingKey():(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -570,6 +573,7 @@
>>> Testing ConvertFromPyObject using d.update({"abc" : %s})
d.update({"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to
convert to vim structure',))
d.update({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
+d.update({"abc" : {u"": 1}}):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
d.update({"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
d.update({"abc" : FailingMappingKey()}):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -595,6 +599,7 @@
>>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : None})):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
d.update(Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+d.update(Mapping({"abc" : {u"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
d.update(Mapping({"abc" : FailingMapping()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
d.update(Mapping({"abc" : FailingMappingKey()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -605,6 +610,7 @@
>>> Testing ConvertFromPyObject using d.update(%s)
d.update(None):(<type 'exceptions.TypeError'>, TypeError("'NoneType' object is
not iterable",))
d.update({"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
+d.update({u"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
d.update(FailingMapping()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
d.update(FailingMappingKey()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -635,6 +641,7 @@
>>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : None}),)):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
d.update((("a", {"abc" : {"": 1}}),)):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+d.update((("a", {"abc" : {u"": 1}}),)):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
d.update((("a", {"abc" : FailingMapping()}),)):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
d.update((("a", {"abc" : FailingMappingKey()}),)):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -660,6 +667,7 @@
>>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : None})),)):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
d.update((("a", Mapping({"abc" : {"": 1}})),)):(<type
'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
+d.update((("a", Mapping({"abc" : {u"": 1}})),)):(<type
'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", Mapping({"abc" : FailingMapping()})),)):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -670,6 +678,7 @@
>>> Testing ConvertFromPyObject using d.update((("a", %s),))
d.update((("a", None),)):(<type 'exceptions.TypeError'>, TypeError('unable to
convert to vim structure',))
d.update((("a", {"": 1}),)):(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
+d.update((("a", {u"": 1}),)):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
d.update((("a", FailingMapping()),)):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
d.update((("a", FailingMappingKey()),)):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -707,6 +716,7 @@
>>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}])
vim.List([{"abc" : None}]):(<type 'exceptions.TypeError'>, TypeError('unable
to convert to vim structure',))
vim.List([{"abc" : {"": 1}}]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+vim.List([{"abc" : {u"": 1}}]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
vim.List([{"abc" : FailingMapping()}]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
vim.List([{"abc" : FailingMappingKey()}]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -732,6 +742,7 @@
>>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : None})]):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
vim.List([Mapping({"abc" : {"": 1}})]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+vim.List([Mapping({"abc" : {u"": 1}})]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
vim.List([Mapping({"abc" : FailingMapping()})]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
vim.List([Mapping({"abc" : FailingMappingKey()})]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -742,6 +753,7 @@
>>> Testing ConvertFromPyObject using vim.List([%s])
vim.List([None]):(<type 'exceptions.TypeError'>, TypeError('unable to convert
to vim structure',))
vim.List([{"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
+vim.List([{u"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
vim.List([FailingMapping()]):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
vim.List([FailingMappingKey()]):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -778,6 +790,7 @@
>>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : None}]:(<type 'exceptions.TypeError'>, TypeError('unable to
convert to vim structure',))
l[:] = [{"abc" : {"": 1}}]:(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
+l[:] = [{"abc" : {u"": 1}}]:(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
l[:] = [{"abc" : FailingMapping()}]:(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
l[:] = [{"abc" : FailingMappingKey()}]:(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -803,6 +816,7 @@
>>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : None})]:(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
l[:] = [Mapping({"abc" : {"": 1}})]:(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+l[:] = [Mapping({"abc" : {u"": 1}})]:(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
l[:] = [Mapping({"abc" : FailingMapping()})]:(<type
'exceptions.NotImplementedError'>, NotImplementedError())
l[:] = [Mapping({"abc" : FailingMappingKey()})]:(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -813,6 +827,7 @@
>>> Testing ConvertFromPyObject using l[:] = [%s]
l[:] = [None]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to
vim structure',))
l[:] = [{"": 1}]:(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
+l[:] = [{u"": 1}]:(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
l[:] = [FailingMapping()]:(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
l[:] = [FailingMappingKey()]:(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -843,6 +858,7 @@
>>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}])
l.extend([{"abc" : None}]):(<type 'exceptions.TypeError'>, TypeError('unable
to convert to vim structure',))
l.extend([{"abc" : {"": 1}}]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+l.extend([{"abc" : {u"": 1}}]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
l.extend([{"abc" : FailingMapping()}]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
l.extend([{"abc" : FailingMappingKey()}]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -868,6 +884,7 @@
>>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : None})]):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
l.extend([Mapping({"abc" : {"": 1}})]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+l.extend([Mapping({"abc" : {u"": 1}})]):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
l.extend([Mapping({"abc" : FailingMapping()})]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
l.extend([Mapping({"abc" : FailingMappingKey()})]):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -878,6 +895,7 @@
>>> Testing ConvertFromPyObject using l.extend([%s])
l.extend([None]):(<type 'exceptions.TypeError'>, TypeError('unable to convert
to vim structure',))
l.extend([{"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
+l.extend([{u"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
l.extend([FailingMapping()]):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
l.extend([FailingMappingKey()]):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -913,6 +931,7 @@
>>> Testing ConvertFromPyObject using f({"abc" : %s})
f({"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to convert
to vim structure',))
f({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
+f({"abc" : {u"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys
are not allowed',))
f({"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
f({"abc" : FailingMappingKey()}):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -938,6 +957,7 @@
>>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : None})):(<type 'exceptions.TypeError'>, TypeError('unable
to convert to vim structure',))
f(Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+f(Mapping({"abc" : {u"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
f(Mapping({"abc" : FailingMapping()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
f(Mapping({"abc" : FailingMappingKey()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -948,6 +968,7 @@
>>> Testing ConvertFromPyObject using f(%s)
f(None):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim
structure',))
f({"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not
allowed',))
+f({u"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not
allowed',))
f(FailingMapping()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
f(FailingMappingKey()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
@@ -973,6 +994,7 @@
>>> Testing ConvertFromPyObject using fd(self={"abc" : %s})
fd(self={"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to
convert to vim structure',))
fd(self={"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
+fd(self={"abc" : {u"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty
keys are not allowed',))
fd(self={"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
fd(self={"abc" : FailingMappingKey()}):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -998,6 +1020,7 @@
>>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : None})):(<type 'exceptions.TypeError'>,
TypeError('unable to convert to vim structure',))
fd(self=Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
+fd(self=Mapping({"abc" : {u"": 1}})):(<type 'exceptions.ValueError'>,
ValueError('empty keys are not allowed',))
fd(self=Mapping({"abc" : FailingMapping()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
fd(self=Mapping({"abc" : FailingMappingKey()})):(<type
'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
@@ -1008,6 +1031,7 @@
>>> Testing ConvertFromPyObject using fd(self=%s)
fd(self=None):(<type 'exceptions.TypeError'>, TypeError('unable to convert
object to vim dictionary',))
fd(self={"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
+fd(self={u"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are
not allowed',))
fd(self=FailingMapping()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
fd(self=FailingMappingKey()):(<type 'exceptions.NotImplementedError'>,
NotImplementedError())
<<< Finished
diff -r 969d365e3905 -r 91666dd3057c src/testdir/test87.in
--- a/src/testdir/test87.in Thu May 30 23:00:46 2013 +0400
+++ b/src/testdir/test87.in Thu May 30 23:39:02 2013 +0400
@@ -814,7 +814,8 @@
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 -r 969d365e3905 -r 91666dd3057c src/testdir/test87.ok
--- a/src/testdir/test87.ok Thu May 30 23:00:46 2013 +0400
+++ b/src/testdir/test87.ok Thu May 30 23:39:02 2013 +0400
@@ -489,6 +489,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s}
d["a"] = {"abc" : None}:(<class 'TypeError'>, TypeError('unable to convert to
vim structure',))
+d["a"] = {"abc" : {b"": 1}}:(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
d["a"] = {"abc" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
d["a"] = {"abc" : FailingMapping()}:(<class 'NotImplementedError'>,
NotImplementedError())
d["a"] = {"abc" : FailingMappingKey()}:(<class 'NotImplementedError'>,
NotImplementedError())
@@ -514,6 +515,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : None}):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+d["a"] = Mapping({"abc" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
d["a"] = Mapping({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
d["a"] = Mapping({"abc" : FailingMapping()}):(<class 'NotImplementedError'>,
NotImplementedError())
d["a"] = Mapping({"abc" : FailingMappingKey()}):(<class
'NotImplementedError'>, NotImplementedError())
@@ -524,6 +526,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = %s
d["a"] = None:(<class 'TypeError'>, TypeError('unable to convert 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())
@@ -558,6 +561,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d.update({"abc" : %s})
d.update({"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to
vim structure',))
+d.update({"abc" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
d.update({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
d.update({"abc" : FailingMapping()}):(<class 'NotImplementedError'>,
NotImplementedError())
d.update({"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -583,6 +587,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+d.update(Mapping({"abc" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
d.update(Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
d.update(Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>,
NotImplementedError())
d.update(Mapping({"abc" : FailingMappingKey()})):(<class
'NotImplementedError'>, NotImplementedError())
@@ -593,6 +598,7 @@
<<< 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())
@@ -623,6 +629,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : None}),)):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+d.update((("a", {"abc" : {b"": 1}}),)):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
d.update((("a", {"abc" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
d.update((("a", {"abc" : FailingMapping()}),)):(<class 'NotImplementedError'>,
NotImplementedError())
d.update((("a", {"abc" : FailingMappingKey()}),)):(<class
'NotImplementedError'>, NotImplementedError())
@@ -648,6 +655,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : None})),)):(<class 'TypeError'>,
TypeError('unable to convert to vim structure',))
+d.update((("a", Mapping({"abc" : {b"": 1}})),)):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
d.update((("a", Mapping({"abc" : {"": 1}})),)):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
d.update((("a", Mapping({"abc" : FailingMapping()})),)):(<class
'NotImplementedError'>, NotImplementedError())
d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(<class
'NotImplementedError'>, NotImplementedError())
@@ -658,6 +666,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", %s),))
d.update((("a", None),)):(<class 'TypeError'>, TypeError('unable to convert 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())
@@ -695,6 +704,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}])
vim.List([{"abc" : None}]):(<class 'TypeError'>, TypeError('unable to convert
to vim structure',))
+vim.List([{"abc" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
vim.List([{"abc" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
vim.List([{"abc" : FailingMapping()}]):(<class 'NotImplementedError'>,
NotImplementedError())
vim.List([{"abc" : FailingMappingKey()}]):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -720,6 +730,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : None})]):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+vim.List([Mapping({"abc" : {b"": 1}})]):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
vim.List([Mapping({"abc" : {"": 1}})]):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
vim.List([Mapping({"abc" : FailingMapping()})]):(<class
'NotImplementedError'>, NotImplementedError())
vim.List([Mapping({"abc" : FailingMappingKey()})]):(<class
'NotImplementedError'>, NotImplementedError())
@@ -730,6 +741,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([%s])
vim.List([None]):(<class 'TypeError'>, TypeError('unable to convert 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())
@@ -766,6 +778,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : None}]:(<class 'TypeError'>, TypeError('unable to convert to
vim structure',))
+l[:] = [{"abc" : {b"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
l[:] = [{"abc" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
l[:] = [{"abc" : FailingMapping()}]:(<class 'NotImplementedError'>,
NotImplementedError())
l[:] = [{"abc" : FailingMappingKey()}]:(<class 'NotImplementedError'>,
NotImplementedError())
@@ -791,6 +804,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : None})]:(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+l[:] = [Mapping({"abc" : {b"": 1}})]:(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
l[:] = [Mapping({"abc" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
l[:] = [Mapping({"abc" : FailingMapping()})]:(<class 'NotImplementedError'>,
NotImplementedError())
l[:] = [Mapping({"abc" : FailingMappingKey()})]:(<class
'NotImplementedError'>, NotImplementedError())
@@ -801,6 +815,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [%s]
l[:] = [None]:(<class 'TypeError'>, TypeError('unable to convert 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())
@@ -831,6 +846,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}])
l.extend([{"abc" : None}]):(<class 'TypeError'>, TypeError('unable to convert
to vim structure',))
+l.extend([{"abc" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
l.extend([{"abc" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
l.extend([{"abc" : FailingMapping()}]):(<class 'NotImplementedError'>,
NotImplementedError())
l.extend([{"abc" : FailingMappingKey()}]):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -856,6 +872,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : None})]):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+l.extend([Mapping({"abc" : {b"": 1}})]):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
l.extend([Mapping({"abc" : {"": 1}})]):(<class 'ValueError'>,
ValueError('empty keys are not allowed',))
l.extend([Mapping({"abc" : FailingMapping()})]):(<class
'NotImplementedError'>, NotImplementedError())
l.extend([Mapping({"abc" : FailingMappingKey()})]):(<class
'NotImplementedError'>, NotImplementedError())
@@ -866,6 +883,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([%s])
l.extend([None]):(<class 'TypeError'>, TypeError('unable to convert to vim
structure',))
+l.extend([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
l.extend([FailingMapping()]):(<class 'NotImplementedError'>,
NotImplementedError())
l.extend([FailingMappingKey()]):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -901,6 +919,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using f({"abc" : %s})
f({"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to vim
structure',))
+f({"abc" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
f({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
f({"abc" : FailingMapping()}):(<class 'NotImplementedError'>,
NotImplementedError())
f({"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -926,6 +945,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to convert
to vim structure',))
+f(Mapping({"abc" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
f(Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys
are not allowed',))
f(Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>,
NotImplementedError())
f(Mapping({"abc" : FailingMappingKey()})):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -936,6 +956,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using f(%s)
f(None):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
+f({b"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
f(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
@@ -961,6 +982,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using fd(self={"abc" : %s})
fd(self={"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to
vim structure',))
+fd(self={"abc" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
fd(self={"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are
not allowed',))
fd(self={"abc" : FailingMapping()}):(<class 'NotImplementedError'>,
NotImplementedError())
fd(self={"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>,
NotImplementedError())
@@ -986,6 +1008,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to
convert to vim structure',))
+fd(self=Mapping({"abc" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
fd(self=Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty
keys are not allowed',))
fd(self=Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>,
NotImplementedError())
fd(self=Mapping({"abc" : FailingMappingKey()})):(<class
'NotImplementedError'>, NotImplementedError())
@@ -996,6 +1019,7 @@
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=%s)
fd(self=None):(<class 'TypeError'>, TypeError('unable to convert object to vim
dictionary',))
+fd(self={b"": 1}):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
fd(self={"": 1}):(<class 'ValueError'>, ValueError('empty keys are not
allowed',))
fd(self=FailingMapping()):(<class 'NotImplementedError'>,
NotImplementedError())
fd(self=FailingMappingKey()):(<class 'NotImplementedError'>,
NotImplementedError())
--
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.