Skip to content

Commit

Permalink
Merge pull request #28 from zopefoundation/27-fix_file_leak
Browse files Browse the repository at this point in the history
Close opened-file leak in blob cache size check.
  • Loading branch information
jimfulton committed Jun 16, 2016
2 parents 7a1a380 + 2f69196 commit a7a5fab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ZEO/ClientStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,8 @@ def _check_blob_cache_size(blob_dir, target):

logger = logging.getLogger(__name__+'.check_blob_cache')

layout = open(os.path.join(blob_dir, ZODB.blob.LAYOUT_MARKER)
).read().strip()
with open(os.path.join(blob_dir, ZODB.blob.LAYOUT_MARKER)) as layout_file:
layout = layout_file.read().strip()
if not layout == 'zeocache':
logger.critical("Invalid blob directory layout %s", layout)
raise ValueError("Invalid blob directory layout", layout)
Expand Down

0 comments on commit a7a5fab

Please sign in to comment.