From e168c30867d8e4773efe7c97366acea00bdcd710 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Jun 2021 11:23:33 +0530 Subject: [PATCH] ANother resourcewarning --- src/calibre/ebooks/oeb/polish/tests/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/tests/base.py b/src/calibre/ebooks/oeb/polish/tests/base.py index 806ab9ae5c..fbdf11cc1e 100644 --- a/src/calibre/ebooks/oeb/polish/tests/base.py +++ b/src/calibre/ebooks/oeb/polish/tests/base.py @@ -56,7 +56,8 @@ def get_simple_book(fmt='epub'): if needs_recompile(ans, src): with TemporaryDirectory('bpt') as 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, { 'LMONOI': P('fonts/liberation/LiberationMono-Italic.ttf'), 'LMONOR': P('fonts/liberation/LiberationMono-Regular.ttf'),