ANother resourcewarning

This commit is contained in:
Kovid Goyal 2021-06-24 11:23:33 +05:30
parent 42c85dfab8
commit e168c30867
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -56,7 +56,8 @@ def get_simple_book(fmt='epub'):
if needs_recompile(ans, src): if needs_recompile(ans, src):
with TemporaryDirectory('bpt') as tdir: with TemporaryDirectory('bpt') as tdir:
with CurrentDir(tdir): with CurrentDir(tdir):
raw = lopen(src, 'rb').read().decode('utf-8') with lopen(src, 'rb') as sf:
raw = sf.read().decode('utf-8')
raw = add_resources(raw, { raw = add_resources(raw, {
'LMONOI': P('fonts/liberation/LiberationMono-Italic.ttf'), 'LMONOI': P('fonts/liberation/LiberationMono-Italic.ttf'),
'LMONOR': P('fonts/liberation/LiberationMono-Regular.ttf'), 'LMONOR': P('fonts/liberation/LiberationMono-Regular.ttf'),