diff options
author | Zackery Spytz <zspytz@gmail.com> | 2022-11-25 09:21:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 09:21:25 (GMT) |
commit | b1dcdefc3abf496a3e37e12b85dd9959f5b70341 (patch) | |
tree | 57d054b5d54d13d87afcb2b0e04258c95da513d6 | |
parent | 3a803bcaacece466e9c137fb4a3c6389780377d6 (diff) | |
download | cpython-b1dcdefc3abf496a3e37e12b85dd9959f5b70341.zip cpython-b1dcdefc3abf496a3e37e12b85dd9959f5b70341.tar.gz cpython-b1dcdefc3abf496a3e37e12b85dd9959f5b70341.tar.bz2 |
bpo-41260: C impl of datetime.date.strftime() takes different keyword arg (GH-21712)
-rw-r--r-- | Lib/datetime.py | 4 | ||||
-rw-r--r-- | Lib/test/datetimetester.py | 3 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-08-02-23-46-22.bpo-41260.Q2BNzY.rst | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/Lib/datetime.py b/Lib/datetime.py index 0174268..1b0c5cb 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -1032,13 +1032,13 @@ class date: _MONTHNAMES[self._month], self._day, self._year) - def strftime(self, fmt): + def strftime(self, format): """ Format using strftime(). Example: "%d/%m/%Y, %H:%M:%S" """ - return _wrap_strftime(self, fmt, self.timetuple()) + return _wrap_strftime(self, format, self.timetuple()) def __format__(self, fmt): if not isinstance(fmt, str): diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index bba9669..121d973 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1489,6 +1489,9 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase): #check that this standard extension works t.strftime("%f") + # bpo-41260: The parameter was named "fmt" in the pure python impl. + t.strftime(format="%f") + def test_strftime_trailing_percent(self): # bpo-35066: Make sure trailing '%' doesn't cause datetime's strftime to # complain. Different libcs have different handling of trailing diff --git a/Misc/NEWS.d/next/Library/2020-08-02-23-46-22.bpo-41260.Q2BNzY.rst b/Misc/NEWS.d/next/Library/2020-08-02-23-46-22.bpo-41260.Q2BNzY.rst new file mode 100644 index 0000000..ae2fdd9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-02-23-46-22.bpo-41260.Q2BNzY.rst @@ -0,0 +1,2 @@ +Rename the *fmt* parameter of the pure Python implementation of +:meth:`datetime.date.strftime` to *format*. |