From 33faab40617aba7a7a9b9f640dbc9464348f2a18 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 26 Apr 2025 20:09:46 +0100 Subject: [PATCH 1/3] Misc fixes --- Lib/_pydatetime.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py index e3db1b52b1159b..471e89c16a1c0e 100644 --- a/Lib/_pydatetime.py +++ b/Lib/_pydatetime.py @@ -1127,8 +1127,8 @@ def isoformat(self): This is 'YYYY-MM-DD'. References: - - http://www.w3.org/TR/NOTE-datetime - - http://www.cl.cam.ac.uk/~mgk25/iso-time.html + - https://www.w3.org/TR/NOTE-datetime + - https://www.cl.cam.ac.uk/~mgk25/iso-time.html """ return "%04d-%02d-%02d" % (self._year, self._month, self._day) @@ -1262,7 +1262,7 @@ def isocalendar(self): The first week is 1; Monday is 1 ... Sunday is 7. ISO calendar algorithm taken from - http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm + https://www.phys.uu.nl/~vgent/calendar/isocalendar.htm (used with permission) """ year = self._year @@ -2089,7 +2089,6 @@ def _local_timezone(self): else: ts = (self - _EPOCH) // timedelta(seconds=1) localtm = _time.localtime(ts) - local = datetime(*localtm[:6]) # Extract TZ data gmtoff = localtm.tm_gmtoff zone = localtm.tm_zone From bedfbf7fbca685b3ec68c44cbe90123b873e6fa2 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Fri, 9 May 2025 16:07:18 +0100 Subject: [PATCH 2/3] Split --- Lib/_pydatetime.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py index 471e89c16a1c0e..b9239622f7fcf4 100644 --- a/Lib/_pydatetime.py +++ b/Lib/_pydatetime.py @@ -2088,7 +2088,6 @@ def _local_timezone(self): ts = ts2 else: ts = (self - _EPOCH) // timedelta(seconds=1) - localtm = _time.localtime(ts) # Extract TZ data gmtoff = localtm.tm_gmtoff zone = localtm.tm_zone From 67b30bb4f41d2c1f8464b73867ba05cd0787f173 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Fri, 9 May 2025 16:08:23 +0100 Subject: [PATCH 3/3] fixup --- Lib/_pydatetime.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py index b9239622f7fcf4..f11eaa50e016e9 100644 --- a/Lib/_pydatetime.py +++ b/Lib/_pydatetime.py @@ -2088,6 +2088,8 @@ def _local_timezone(self): ts = ts2 else: ts = (self - _EPOCH) // timedelta(seconds=1) + localtm = _time.localtime(ts) + local = datetime(*localtm[:6]) # Extract TZ data gmtoff = localtm.tm_gmtoff zone = localtm.tm_zone