From a9623c44c8e646aee84cc24fd70289a6daee9f64 Mon Sep 17 00:00:00 2001 From: Ben Hsing Date: Mon, 24 Jun 2024 02:44:01 +0000 Subject: [PATCH] gh-120713: test that a 0-padded year with century is guaranteed --- Lib/test/datetimetester.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index e55b738eb4a975..ce5a0b6ad00098 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1699,16 +1699,7 @@ def test_bool(self): def test_strftime_y2k(self): for y in (1, 49, 70, 99, 100, 999, 1000, 1970): d = self.theclass(y, 1, 1) - # Issue 13305: For years < 1000, the value is not always - # padded to 4 digits across platforms. The C standard - # assumes year >= 1900, so it does not specify the number - # of digits. - if d.strftime("%Y") != '%04d' % y: - # Year 42 returns '42', not padded - self.assertEqual(d.strftime("%Y"), '%d' % y) - # '0042' is obtained anyway - if support.has_strftime_extensions: - self.assertEqual(d.strftime("%4Y"), '%04d' % y) + self.assertEqual(d.strftime("%4Y"), '%04d' % y) def test_replace(self): cls = self.theclass