From 0c0028a9d3be4fc98bbdf975a6e0daa663bbed2d Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Mon, 24 Oct 2022 21:13:36 +0900 Subject: [PATCH] UnknownTimeZoneError --- modules/images.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/images.py b/modules/images.py index 848ede756..9a8fe3ed4 100644 --- a/modules/images.py +++ b/modules/images.py @@ -344,7 +344,10 @@ class FilenameGenerator: time_datetime = datetime.datetime.now() time_format = args[0] if len(args) > 0 else self.default_time_format - time_zone = pytz.timezone(args[1]) if len(args) > 1 else None + try: + time_zone = pytz.timezone(args[1]) if len(args) > 1 else None + except pytz.exceptions.UnknownTimeZoneError as _: + time_zone = None time_zone_time = time_datetime.astimezone(time_zone) try: