#191 closed defect (fixed)
[PATCH] AttributeError: 'NoneType' object has no attribute 'perm'
Reported by: | anonymous | Owned by: | cmlenz |
---|---|---|---|
Priority: | minor | Milestone: | 0.6 |
Component: | General | Version: | 0.5.3 |
Keywords: | Cc: | ||
Operating System: | Linux |
Description
While doing a GET operation on /build, Trac issued an internal error.
Posted this on trac; http://trac.edgewall.org/ticket/6061, and Simon said it was a bitten issue.
Also to note: I changed the _render_overview to take string Zzzzzz Zzzzz? and reproduced the error; however, everything was fine when I gave it Zzzzzzzzzzz.
System Information
Trac | 0.11dev-r6048 |
Python | 2.5.1 (r251:54863, Oct 3 2007, 14:29:51) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] |
setuptools | 0.6c7 |
SQLite | 3.4.2 |
pysqlite | 2.3.5 |
Genshi | 0.4.4 |
Subversion | 1.4.5 (r25188) |
Python Traceback
Traceback (most recent call last): File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/web/main.py", line 381, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/web/main.py", line 191, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/lib/python2.5/site-packages/Bitten-0.6dev_r510-py2.5.egg/bitten/web_ui.py", line 128, in process_request self._render_overview(req) File "/usr/lib/lib/python2.5/site-packages/Bitten-0.6dev_r510-py2.5.egg/bitten/web_ui.py", line 171, in _render_overview shorten_line(chgset.message), self.env) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/formatter.py", line 1052, in wiki_to_oneliner OneLinerFormatter(ctx).format(wikitext, out, shorten) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/formatter.py", line 881, in format result = re.sub(self.wikiparser.rules, self.replace, result) File "/usr/lib/lib/python2.5/re.py", line 142, in sub return _compile(pattern, 0).sub(repl, string, count) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/formatter.py", line 735, in replace replacement = self.handle_match(fullmatch) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/formatter.py", line 728, in handle_match return external_handler(self, match, fullmatch) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/api.py", line 309, in wikipagename_link self.ignore_missing_pages) File "/usr/lib/lib/python2.5/site-packages/Trac-0.11dev_r6048-py2.5.egg/trac/wiki/api.py", line 345, in _format_link if 'WIKI_VIEW' not in req.perm(context): AttributeError: 'NoneType' object has no attribute 'perm'
Attachments (2)
Change History (6)
Changed 17 years ago by david at artcom dot de
comment:1 Changed 17 years ago by david at artcom dot de
I got the same error after a colleague used a camel-case word in his commit message. I think the reason is a signature/API change of wiki_to_oneliner() beween Trac-0.10 and Trac-0.11dev. The attached patch resolves the issue by explicitly passing the request object to wiki_to_oneliner().
comment:2 Changed 17 years ago by anonymous
- Summary changed from AttributeError: 'NoneType' object has no attribute 'perm' to [PATCH] AttributeError: 'NoneType' object has no attribute 'perm'
comment:3 Changed 17 years ago by reedstrm@…
I've seen this exact case, as well: a potential Wiki Word? in the patch triggers it. I've attached my version of the patch, using a keyword arg, instead of repeating all the defaults to wiki_one_liner() here in bitten.
Changed 17 years ago by reedstrm@…
Fixes up use of wili_to_oneliner() so Wiki Words? don't break the status page
comment:4 Changed 16 years ago by cmlenz
- Resolution set to fixed
- Status changed from new to closed
This should now be properly fixed in r554.
[PATCH] pass request object to wiki_to_oneliner()