From 9e4a610e2bdab2ff15d222f8c4b4b802fb38ef12 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Tue, 25 Jul 2023 13:15:59 +0200 Subject: [PATCH] Use today() as it is already used somewhere else and sufficient --- pyproject.toml | 4 ++-- src/kolibri2zim/scraper.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 96879ec..659a2d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,8 +162,8 @@ select = [ ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", - # Allow use of datetime with tz and date.today - "DTZ005", "DTZ011", + # Allow use of date.today + "DTZ011", # Remove flake8-errmsg since we consider they bloat the code and provide limited value "EM", # Allow boolean positional values in function calls, like `dict.get(... True)` diff --git a/src/kolibri2zim/scraper.py b/src/kolibri2zim/scraper.py index 412bcf4..e812305 100644 --- a/src/kolibri2zim/scraper.py +++ b/src/kolibri2zim/scraper.py @@ -927,7 +927,7 @@ def sanitize_inputs(self): channel_meta = self.db.get_channel_metadata(self.channel_id) # input & metadata sanitation - period = datetime.datetime.now().strftime("%Y-%m") + period = datetime.date.today().strftime("%Y-%m") if self.fname: # make sure we were given a filename and not a path fname_path = Path(str(self.fname).format(period=period))