-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls to convert_*
have misaligned arguments
#89
Comments
@mmabey Thanks for reporting this issue. I am a bit swamped at work these days. Since you are already familiar with the issue, would you like to send a pull request with a test reproducing the error and the fix that resolves it? It would be wonderful if you could do that, else I will find time to get it done this weekend. Cheers 🎉 |
resolves #89, the params were wrong and will fail for some edge cases. Now, all parameters are with the keyword and there are more no bugs. Authored-by: Vinit Kumar <mail@vinitkumar.me> Signed-off-by: Vinit Kumar <mail@vinitkumar.me>
@mmabey The issues is fixed and release to the pypi here: Please upgrade your package and it should just work. I have also added a test for the case if the error every comes. |
I am closing this issues, if the issue still persists, please reopen the issue. |
Describe the bug
In the
convert()
function indicttoxml.py
, there are several calls to convert_* functions that use positional arguments that are getting sent to the wrong parameters.For example,
json2xml/json2xml/dicttoxml.py
Line 146 in 451d3d3
makes a call to
convert_kv()
, but the signature of that function has thecdata
parameter after theattr
parameter, so the two get mixed up on the call:json2xml/json2xml/dicttoxml.py
Line 361 in 451d3d3
I think if these calls were switched to use keyword parameters, this bug would be fixed very quickly. Presently, though, it's causing things to fail for me.
To Reproduce
Running the following in a Python console shows the error I'm seeing:
The resulting
AttributeError: 'bool' object has no attribute 'items'
error is a result ofattr
being set toFalse
instead of its default value of an empty dict{}
.The text was updated successfully, but these errors were encountered: