diff -r 2fe19ba68daa -r 894c14f08380 web/views/schema.py --- a/web/views/schema.py Wed Dec 09 16:36:17 2015 +0100 +++ b/web/views/schema.py Mon Dec 14 12:11:44 2015 +0100 @@ -657,10 +657,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 ##################################################################