GNOME Bugzilla – Bug 752658
XML empty <argsstring/> in python
Last modified: 2015-07-26 11:11:57 UTC
Hi, I'm trying to document the python package https://github.com/simplejson/simplejson, and looking on the xml output. In the majority of functions, it does correctly output the argsstring, but in some cases it does not. For example: 1) simplejson.encoder.JSONEncoderForHTML.iterencode: <memberdef kind="function" id="classsimplejson_1_1encoder_1_1JSONEncoderForHTML_1af33783f5eb7f4662509c3e14025a106a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>def</type> <definition>def simplejson.encoder.JSONEncoderForHTML.iterencode</definition> <argsstring/> <name>iterencode</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="simplejson/encoder.py" line="380" column="1" bodyfile="simplejson/encoder.py" bodystart="380" bodyend="388"/> </memberdef> 2) simplejson.ordered_dict.OrderedDict.fromkeys: <memberdef kind="function" id="classsimplejson_1_1ordered__dict_1_1OrderedDict_1a2167f66a1c59b2a89bbebab3d02e3353" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>def</type> <definition>def simplejson.ordered_dict.OrderedDict.fromkeys</definition> <argsstring/> <name>fromkeys</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="simplejson/ordered_dict.py" line="106" column="1" bodyfile="simplejson/ordered_dict.py" bodystart="106" bodyend="111"/> </memberdef> I have seen it happening in other packages as well, but unfortunately can't find a logic when exactly this bug appears. If you need any more info regarding this issue I'll be happy to provide. Thanks.
Problem comes (checked for the 2 situations described) from the fact that the last argument has a default value, and the end of the list is not handled properly. I've just pushed a proposed patch to github (pull request 371).
Thanks very much for the speedy fix. I did report this issue a while ago as a follow up in ticket #739056: https://bugzilla.gnome.org/show_bug.cgi?id=739056#c4 Status Reopened. If you have a working setup, please check if this fixes #739056, and close it as well. Thx again, I'll keep an eye open for more cases if I encounter them in the future.
In my setup, the latest git with changes you suggested to src/pyscanner.l , somehow the problems (1),(2) remain. I'm not very fluent in git/github, so it might be the cause for that. When the pull request is merged, I'll retry.
(In reply to erez.oxman from comment #2) > Thanks very much for the speedy fix. > > I did report this issue a while ago as a follow up in ticket #739056: > https://bugzilla.gnome.org/show_bug.cgi?id=739056#c4 > Status Reopened. > > If you have a working setup, please check if this fixes #739056, and close > it as well. > > Thx again, I'll keep an eye open for more cases if I encounter them in the > future. Bug 739056 - Python xml - argsstring is empty, while HTML have arguments indeed looks to me that it is the same problem.
(In reply to erez.oxman from comment #3) > In my setup, the latest git with changes you suggested to src/pyscanner.l , > somehow the problems (1),(2) remain. > > I'm not very fluent in git/github, so it might be the cause for that. When > the pull request is merged, I'll retry. Strange that this does not work for you. Please test again and put a print statement into the pyscanner.l so you are sure that you use the right version.
I've merged the pull request 371. Let me know if it correctly solves the issue.
Everything works great now, bug solved. Thanks again for all the help.