From e882a4bca8b2f991c9d91bd4eab765bf27e62575 Mon Sep 17 00:00:00 2001 From: jaca Date: Thu, 20 Oct 2022 22:10:47 +0200 Subject: [PATCH] strip slash before passing tzid to pytz --- src/icalendar/prop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icalendar/prop.py b/src/icalendar/prop.py index 36d2b94..56d516f 100644 --- a/src/icalendar/prop.py +++ b/src/icalendar/prop.py @@ -414,10 +414,10 @@ class vDatetime: tzinfo = None if timezone: try: - tzinfo = pytz.timezone(timezone) + tzinfo = pytz.timezone(timezone.strip('/')) except pytz.UnknownTimeZoneError: if timezone in WINDOWS_TO_OLSON: - tzinfo = pytz.timezone(WINDOWS_TO_OLSON.get(timezone)) + tzinfo = pytz.timezone(WINDOWS_TO_OLSON.get(timezone.strip('/'))) else: tzinfo = _timezone_cache.get(timezone, None)