On 30/12/23 11:27, Guido Günther wrote:
from gbp.git.modifier import GitModifier # noqa: F401
@@ -41,7 +42,11 @@ def rfc822_date_to_git(rfc822_date, fuzzy=False):
>>> rfc822_date_to_git('So, 26 Feb 1998 8:50:00 +0100', fuzzy=True)
'888479400 +0100'
"""
+ rfc822_date_orig = rfc822_date
+ rfc822_date = rfc822_date.replace(":60 ", ":59 ")
d = dateutil.parser.parse(rfc822_date, fuzzy=fuzzy)
+ if rfc822_date != rfc822_date_orig: # Handle leap seconds.
+ d += datetime.timedelta(seconds=1)
That works. Could you add a line to the doctest in that function too so
we check for and don't break it on accident again. Otherwise I can do it
when applying the patch.
Hi Guido, I'll be happy to leave the doctest to you. :)
Thanks for accepting the patch.
PS: Beware: the indentation may be wrong.
Regards,
--
Gioele Barasbucci.