From 0158fb829596ba7ac31f8d3366440491946362f6 Mon Sep 17 00:00:00 2001 From: Eugen Ciur Date: Mon, 17 Aug 2020 11:24:16 +0200 Subject: [PATCH] minor fix in mglib.utils --- changelog.md | 5 +++++ mglib/utils.py | 6 +++++- setup.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 9917620..ec281b1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,11 @@ # Changelog +## [1.2.7] - 17 August 2020 + +### Changed + +- Do not raise exception when encoutering unsafe extention, log warning message instead. ## [1.2.6] - 11 August 2020 diff --git a/mglib/utils.py b/mglib/utils.py index 2aefdb0..ef62559 100644 --- a/mglib/utils.py +++ b/mglib/utils.py @@ -44,7 +44,11 @@ def safe_to_delete(place): for name in files: base, ext = os.path.splitext(name) if ext not in SAFE_EXTENSIONS: - raise Exception("Trying to delete unsefe location") + logger.warning( + f"Trying to delete unsefe location: " + f"extention={ext} not found in {SAFE_EXTENSIONS}" + ) + return False return True diff --git a/setup.py b/setup.py index 19a4e59..3c0410a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r") as fh: setup( name="mglib", - version="1.2.6", + version="1.2.7", author="Eugen Ciur", author_email="eugen@papermerge.com", url="https://github.com/papermerge/mglib",