rcltext.py: make sure to close file (windows temp file removal)
This commit is contained in:
parent
7d168dc198
commit
16a051c3b6
@ -31,8 +31,8 @@ class TxtDump(RclBaseHandler):
|
|||||||
def html_text(self, fn):
|
def html_text(self, fn):
|
||||||
# No charset, so recoll will have to use its config to guess it
|
# No charset, so recoll will have to use its config to guess it
|
||||||
html = b'<html><head><title></title></head><body><pre>'
|
html = b'<html><head><title></title></head><body><pre>'
|
||||||
f = open(fn, "rb")
|
with open(fn, "rb") as f:
|
||||||
html += self.em.htmlescape(f.read())
|
html += self.em.htmlescape(f.read())
|
||||||
html += b'</pre></body></html>'
|
html += b'</pre></body></html>'
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user