From 1ef16359c33fe9648f8b60b9db663d162e8fdc55 Mon Sep 17 00:00:00 2001 From: Alexey Rubaseff Date: Wed, 6 Mar 2024 15:41:50 +0200 Subject: [PATCH] ! v0.3.32 --- HISTORY.rst | 6 ++++++ global_logger/__init__.py | 2 +- global_logger/global_logger.py | 6 +++++- setup.cfg | 2 +- setup.py | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 31425cc..56e80b3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,12 @@ History ======= +0.3.32 (2024-06-03) +------------------- + +* Precaution: fallback to UTC if local timezone raises an Exception + + 0.3.31 (2023-11-05) ------------------- diff --git a/global_logger/__init__.py b/global_logger/__init__.py index 5a18056..155fee0 100644 --- a/global_logger/__init__.py +++ b/global_logger/__init__.py @@ -2,6 +2,6 @@ __author__ = """Alexey Rubasheff""" __email__ = 'alexey.rubasheff@gmail.com' -__version__ = '0.3.31' +__version__ = '0.3.32' from .global_logger import Log # noqa # pylint: disable=unused-import diff --git a/global_logger/global_logger.py b/global_logger/global_logger.py index 8a98fde..d77c4c3 100644 --- a/global_logger/global_logger.py +++ b/global_logger/global_logger.py @@ -134,7 +134,11 @@ def __init__(self, name, level=None, global_level=True, logs_dir=None, log_sessi Log.logs_dir.mkdir(parents=True) if Log.log_session_filename is None: - now = pendulum.now(tz=pendulum.local_timezone()) + try: + tz = pendulum.local_timezone() + except: + tz = pendulum.timezone('UTC') + now = pendulum.now(tz) Log.log_session_filename = "%s.log" % now.strftime('%Y-%m-%d_%H-%M-%S') self._clean_logs_folder() diff --git a/setup.cfg b/setup.cfg index 6841bfd..55114c4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.31 +current_version = 0.3.32 commit = True tag = True diff --git a/setup.py b/setup.py index c4c20db..4a44549 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,6 @@ test_suite='tests', tests_require=test_requirements, url='https://github.com/alertua/global_logger', - version='0.3.31', + version='0.3.32', zip_safe=False, )