Commit a7a5fab7 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #28 from zopefoundation/27-fix_file_leak

Close opened-file leak in blob cache size check.
parents 7a1a3804 2f691967
...@@ -1667,8 +1667,8 @@ def _check_blob_cache_size(blob_dir, target): ...@@ -1667,8 +1667,8 @@ def _check_blob_cache_size(blob_dir, target):
logger = logging.getLogger(__name__+'.check_blob_cache') logger = logging.getLogger(__name__+'.check_blob_cache')
layout = open(os.path.join(blob_dir, ZODB.blob.LAYOUT_MARKER) with open(os.path.join(blob_dir, ZODB.blob.LAYOUT_MARKER)) as layout_file:
).read().strip() layout = layout_file.read().strip()
if not layout == 'zeocache': if not layout == 'zeocache':
logger.critical("Invalid blob directory layout %s", layout) logger.critical("Invalid blob directory layout %s", layout)
raise ValueError("Invalid blob directory layout", layout) raise ValueError("Invalid blob directory layout", layout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment