Opened 19 years ago
Last modified 18 years ago
#164 assigned defect
Pydoc Heisenbugs
Reported by: | Noah Kantrowitz | Owned by: | Alec Thomas |
---|---|---|---|
Priority: | normal | Component: | PyDocPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: |
Description
I am getting really weird, seemingly random glitches from the Pydoc plugin.
Things like it will say that no documentation is found for a file, but if I refresh a few times it might show me the docs, and then go back to "not found" the next time I load the page.
Below is a traceback from on of the common errors. This error will also sometimes show up on a wiki page if I have used a [pydoc:] link on it.
Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler dispatch_request(mpr.path_info, mpr, env) File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 107, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 116, in process_request self._render_view(req, db, page) File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 364, in _render_view req.hdf['wiki.page_html'] = wiki_to_html(page.text, self.env, req) File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 744, in wiki_to_html Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines) File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 599, in format result = re.sub(self.rules, self.replace, line) File "/usr/lib/python2.4/sre.py", line 142, in sub return _compile(pattern, 0).sub(repl, string, count) File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 221, in replace return getattr(self, '_' + itype + '_formatter')(match, fullmatch) File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 290, in _lhref_formatter return self._make_link(ns, target, match, label) File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 295, in _make_link util.escape(label, False)) File "build/bdist.linux-i686/egg/tracpydoc/tracpydoc.py", line 322, in _pydoc_formatter File "build/bdist.linux-i686/egg/tracpydoc/tracpydoc.py", line 195, in load_object File "/var/www/gopetsdev/head/snofight/main.py", line 3, in ? import pygame, sys File "/usr/lib/python2.4/site-packages/pygame/__init__.py", line 71, in ? Color = color.Color NameError: name 'color' is not defined
Attachments (0)
Change History (5)
comment:1 Changed 19 years ago by
comment:2 Changed 19 years ago by
Your version seems to be modified, line 322 of tracpydoc.py is
return '<a class="wiki" href="%s">%s</a>' % \ (formatter.href.pydoc(), label)
Can you revert to trunk and try again?
comment:3 Changed 19 years ago by
Owner: | changed from alect to Alec Thomas |
---|---|
Status: | new → assigned |
Try this patch, it unloads each module after it generates the documentation:
-
tracpydoc/tracpydoc.py
237 237 return "No Python documentation found for '%s'" % target 238 238 239 239 def _makedoc(self, target, visibility): 240 already_imported = sys.modules.copy() 240 241 module, object = self.load_object(target) 241 242 try: 242 243 self.makedoc_lock.acquire() … … 263 264 else: 264 265 return self.doc.document(object) 265 266 finally: 267 for modname in sys.modules.copy(): 268 if modname not in already_imported: 269 self.env.log.debug("Unloading module %s" % modname) 270 del(sys.modules[modname]) 266 271 self.makedoc_lock.release() 267 272 268 273 # INavigationContributor methods
comment:5 Changed 19 years ago by
That patch didn't seem to help.
My install is here, so you can look around to see whats happening.
As a partial work around, I have set up the GeneralLinkSyntax plugin? to provide the
[pydoc:foo]
wiki syntax (to /pydoc/%s)