diff --git a/CHANGES b/CHANGES index 8ffd9379654b116e3b3127d0f8de35d8cdb881ec..7132504c253a33391aec04c07b5fd6b8429b5d3c 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ Paul Colomiets - fixed expressions and page tag arguments and with embedded newlines in CRLF templates, follow up to [ticket:16], thanks Eric Woroshow +- added an IOError catch for source file not found in RichTraceback +exception reporter [ticket:51] 0.1.8 - variable names declared in render methods by internal diff --git a/lib/mako/exceptions.py b/lib/mako/exceptions.py index 5cad373d4e79613e38611fda726cdf540b562686..3f12cd4a6e0007d103195aaa969ced15d34c8cb0 100644 --- a/lib/mako/exceptions.py +++ b/lib/mako/exceptions.py @@ -138,7 +138,10 @@ class RichTraceback(object): self.lineno = new_trcback[l][5] break else: - self.source = file(new_trcback[-1][0]).read() + try: + self.source = file(new_trcback[-1][0]).read() + except IOError: + self.source = '' self.lineno = new_trcback[-1][1] return (type, value, new_trcback)