After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693839 - Functions missing from pydoc report
Functions missing from pydoc report
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 695394 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-14 20:17 UTC by Niklas Koep
Modified: 2013-03-14 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prefix __module__ attribute of function objects with gi.repository (1007 bytes, patch)
2013-02-14 20:17 UTC, Niklas Koep
none Details | Review

Description Niklas Koep 2013-02-14 20:17:32 UTC
Created attachment 236148 [details] [review]
Prefix __module__ attribute of function objects with gi.repository

There appears to be a problem which causes introspected functions defined on module-level to be missing from pydoc's module report. I've looked into this and the root cause of the problem seems to be that introspected functions of a module `Foo' also have `Foo' set as their __module__ attribute instead of `gi.repository.Foo'. This poses problems in Python's pydoc.TextDoc.docmodule method where the list of module functions is first populated. Before the function is added to the funcs list inspect.getmodule() is called with the function object and the result is compared to the original module. The inspect.getmodule() call returns None though as the module is cached with "gi.repository.Foo" in sys.modules instead of "Foo". If a module defines __all__ this check is skipped. 
I've attached a patch which fixes the issue. It also corrects a typo in two docstrings of the same module.
Comment 1 Simon Feltman 2013-02-16 05:45:44 UTC
Thanks. Commited with an additional fix for function caches which was found running "make check"

The following fixes have been pushed:
Comment 2 EvilGnome 2013-03-14 13:21:17 UTC
*** Bug 695394 has been marked as a duplicate of this bug. ***