syntax-highlighting.py: file not shown if no lexer found

Peter Colberg peter at colberg.org
Fri Nov 18 04:41:45 CET 2016


Hi,

I am forwarding a bug reported against cgit 1.0 in Debian.

https://bugs.debian.org/784621

syntax-highlighting.py aborts due to an unhandled exception if the
inner call to guess_lexer() throws ClassNotFound. Please see the
attached patch by Daniel Reichelt that resolves the issue.

Is the handling of TypeError for the outer call still needed? The
documentation mentions only ClassNotFound as a possible exception.

http://pygments.org/docs/api/#pygments.lexers.guess_lexer_for_filename

Regards,
Peter
-------------- next part --------------
An embedded message was scrubbed...
From: Daniel Reichelt <debian at nachtgeist.net>
Subject: [Pkg-cgit-devel] Bug#784621: cgit: file not shown if no lexer found
Date: Thu, 17 Nov 2016 23:48:57 +0100
Size: 6460
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20161117/1cbb03ca/attachment.mht>


More information about the CGit mailing list