Open briantoby opened 3 years ago
Hi @briantoby. I can successfully reproduce this bug. Some of my modules don't load as well. Maybe @dalthviz can give us an idea on why this could be happening or where to start debugging?
I have gotten a bit farther on this and see that the assert is in pydoc_patch.CustomHTMLDoc.docclass. I have a hunch that the difference between modules that are displayed and the ones that give the assert error is related to if the module defines classes.
FWIW, removing the assert does allows me to see docs for those classes (though they are huge when inheriting from big classes). Will spend some more time on this.
Thanks for your help @briantoby!
Ok a bit farther:
If I create a simple module, with functions and variables, pydoc_patch seems to work fine. As soon as I define a class -- no matter how simple -- the assert causes a problem. I really don't understand exactly what that while loop is supposed to be doing, but it seems that it is pulling info out of attrs, so I do not understand why if it is empty that should be a problem.
The above is wrong -- see later comment
A second issue is that if my class subclasses from something large (as an example, I use wx.Dialog often), then the docs get huge as all of the parent's definitions get included due to the attrs = inherited
line. I would vote to remove that, so perhaps this should be an option for the plug-in.
This is great @briantoby! Would you mind creating a pull request with your changes?
For that, please follow our Contributing guide and make it against our 5.x
branch (not 4.x
):
https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md
@ccordoba12 I am still coming up to speed on git. Also, I would like to see if I can figure out how to add an option for a plugin, but I will create a pull request with either some brain-dead changes (lines commented) or perhaps something a bit better.
No problem, any help is really appreciated.
This is wrong:
If I create a simple module, with functions and variables, pydoc_patch seems to work fine. As soon as I define a class -- no matter how simple -- the assert causes a problem. I really don't understand exactly what that while loop is supposed to be doing, but it seems that it is pulling info out of attrs, so I do not understand why if it is empty that should be a problem.
Simple classes work fine, but in when I subclass, at least from wx, this error occurs. What is happening is that as each stanza of spill_____()
works on the attrs, it pulls info out and at the assert point, if anything is left it is not included in the documentation. When I sublass wx.Dialog, there are still readonly items still left. Perhaps a warning should be included, but there is no reason to abort display IMHO.
I have created a PR & updated it. I hope I have done this correctly. I am finding PRs in github rather bewildering.
Problem Description
Display of docs of my Python modules in "Online help" sometimes fails
What steps reproduce the problem?
Clicking on the several of my Python modules in "Online help" reproducibly gives me a display with only the following three lines:
What is the expected output? What do you see instead?
It does work for most of my modules. I originally found that the problem was that I did not have some of the packages I needed to import the modules in question in the Python that would not display, but I have since loaded and confirmed that I can view the documentation in pydoc in the same Python image I use to run spyder.
I am happy to debug, but need some suggestions on how.
Paste Traceback/Error Below (if applicable)
No messages in internal console
Versions
Note that this bug also shows up in other, older versions of Spyder
Dependencies