Opened 9 years ago
Last modified 8 years ago
#12183 closed defect
Possible mistyped processor on TracDownload — at Version 4
Reported by: | figaro | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.9 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Prevent WikiProcessor error in TracGuide when Pygments is not installed. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
At the bottom of page TracDownload the following is shown: Error: Failed to load processor apache No macro or processor named 'apache' found
This is possibly the result of a mistyped processor on that page.
Change History (4)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Possible mistyped processor on TracDownload#LatestStableRelease → Possible mistyped processor on TracDownload |
comment:2 by , 9 years ago
This is due to a Pygments installation issue that I've noted in our internal issue tracker. However, the issue is also present on TracModWSGI which gets distributed with Trac so the errors will be seen whenever Pygments is not installed. We should probably add a known mimetype for the ApacheConf Lexer:
-
trac/mimeview/api.py
diff --git a/trac/mimeview/api.py b/trac/mimeview/api.py index aae3172..96f2c72 100644
a b KNOWN_MIME_TYPES = { 304 304 'text/xml': 'xml', 305 305 306 306 # see also TEXT_X_TYPES below 307 'text/x-apacheconf': 'apache', 307 308 'text/x-csrc': 'c xs', 308 309 'text/x-chdr': 'h', 309 310 'text/x-c++src': 'cc CC cpp C c++ C++',
comment:3 by , 9 years ago
That change looks good to me. We could add check of invalid wiki processors to checkwiki.py
.
-
contrib/checkwiki.py
diff --git a/contrib/checkwiki.py b/contrib/checkwiki.py index c9b8029ff..fbc874dbd 100755
a b class DefaultWikiChecker(Formatter): 51 51 self.__marks.append((fullmatch.start(0), fullmatch.end(0))) 52 52 return rv 53 53 54 def handle_code_block(self, line, startmatch=None): 55 prev_processor = getattr(self, 'code_processor', None) 56 try: 57 return self.__super.handle_code_block(line, startmatch) 58 finally: 59 processor = self.code_processor 60 if startmatch and processor and processor != prev_processor and \ 61 processor.error: 62 self.__marks.append((startmatch.start(0), startmatch.end(0))) 63 54 64 def format(self, text, out=None): 55 65 return self.__super.format(SourceWrapper(self, text), out) 56 66 … … def main(): 160 170 if options.download: 161 171 download_default_pages(args, options.prefix) 162 172 163 env = EnvironmentStub( )173 env = EnvironmentStub(disable=['trac.mimeview.pygments.*']) 164 174 load_components(env) 165 175 with env.db_transaction: 166 176 for name in names:
The same issue raises on #!pycon
in TracPlugins page.
$ python contrib/checkwiki.py | grep '#!' | sed -e 's/^\([^:]*\):[0-9]*:\(.*\)$/\1:\2/' | sort | uniq -c 3 TracCgi:{{{#!apache 1 TracFineGrainedPermissions:{{{#!apache 3 TracInstall:{{{#!apache 3 TracInterfaceCustomization:{{{#!apache 18 TracModPython:{{{#!apache 15 TracModWSGI:{{{#!apache 4 TracPlugins:{{{#!apache 1 TracPlugins:{{{#!pycon 1 TracStandalone:{{{#!apache
Updated description and summary.