Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/oidcmsg/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def configure_logging(debug: Optional[bool] = False,
config_source = 'dictionary'
elif filename is not None and os.path.exists(filename):
with open(filename, "rt") as file:
config_dict = yaml.load(file)
config_dict = yaml.safe_load(file)
config_source = 'file'
else:
config_dict = LOGGING_DEFAULT
Expand Down
5 changes: 4 additions & 1 deletion src/oidcmsg/time_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""

import calendar
import logging
import re
import sys
import time
Expand All @@ -30,6 +31,8 @@
TIME_FORMAT_WITH_FRAGMENT = re.compile("^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})\.\d*Z$")


logger = logging.getLogger(__name__)

class TimeUtilError(Exception):
pass

Expand Down Expand Up @@ -287,7 +290,7 @@ def str_to_time(timestr, time_format=TIME_FORMAT):
try:
elem = TIME_FORMAT_WITH_FRAGMENT.match(timestr)
except Exception as exc:
print >>sys.stderr, "Exception: %s on %s" % (exc, timestr)
logger.error("Exception: %s on %s" % (exc, timestr))
raise
then = time.strptime(elem.groups()[0] + "Z", TIME_FORMAT)

Expand Down