--- a/web/views/schema.py Fri Dec 11 14:07:51 2015 +0100
+++ b/web/views/schema.py Tue Dec 15 14:12:59 2015 +0100
@@ -660,10 +660,13 @@
}))
# svg image file
fd, tmpfile = tempfile.mkstemp('.svg')
- os.close(fd)
- generator.generate(visitor, prophdlr, tmpfile)
- with codecs.open(tmpfile, 'rb', encoding='utf-8') as svgfile:
- self.w(svgfile.read())
+ try:
+ os.close(fd)
+ generator.generate(visitor, prophdlr, tmpfile)
+ with codecs.open(tmpfile, 'rb', encoding='utf-8') as svgfile:
+ self.w(svgfile.read())
+ finally:
+ os.unlink(tmpfile)
# breadcrumbs ##################################################################