From 56da1fc87c1623ea5ad1d3bf51278f2f0484dab0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 14:54:15 +0000 Subject: [PATCH] Remove Python < 3.7 timezone workaround in _rfc3339.py Python 3.7+ supports %z with colons in timezone offsets. Since this project now requires Python >= 3.9, the regex substitution to remove colons from timezone offsets is no longer necessary and can be removed. Co-authored-by: lahirumaramba <55609+lahirumaramba@users.noreply.github.com> --- firebase_admin/_rfc3339.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/firebase_admin/_rfc3339.py b/firebase_admin/_rfc3339.py index 8489bdcb..3de5ddbc 100644 --- a/firebase_admin/_rfc3339.py +++ b/firebase_admin/_rfc3339.py @@ -68,12 +68,6 @@ def _parse_to_datetime(datestr): except ValueError: pass - # Note: %z parses timezone offsets, but requires the timezone offset *not* - # include a separating ':'. As of python 3.7, this was relaxed. - # TODO(rsgowman): Once python3.7 becomes our floor, we can drop the regex - # replacement. - datestr_modified = re.sub(r'(\d\d):(\d\d)$', r'\1\2', datestr_modified) - try: return datetime.strptime(datestr_modified, '%Y-%m-%dT%H:%M:%S.%f%z') except ValueError: