diff options
author | Paul Ganssle <pganssle@users.noreply.github.com> | 2019-04-27 19:39:40 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2019-04-27 19:39:40 (GMT) |
commit | 4d8c8c0ad6163c24136d3419eb04f310b31f7e64 (patch) | |
tree | 445d3de23677da75d5c1d3346a45d799b4874b48 /Misc | |
parent | 5c403b203510549a3f89d138d3265c5cc0cc12af (diff) | |
download | cpython-4d8c8c0ad6163c24136d3419eb04f310b31f7e64.zip cpython-4d8c8c0ad6163c24136d3419eb04f310b31f7e64.tar.gz cpython-4d8c8c0ad6163c24136d3419eb04f310b31f7e64.tar.bz2 |
bpo-36025: Fix PyDate_FromTimestamp API (GH-11922)
In the process of converting the date.fromtimestamp function to use
argument clinic in GH-8535, the C API for PyDate_FromTimestamp was
inadvertently changed to expect a timestamp object rather than an
argument tuple.
This PR fixes this backwards-incompatible change by adding a new wrapper
function for the C API function that unwraps the argument tuple and
passes it to the underlying function.
This PR also adds tests for both PyDate_FromTimestamp and
PyDateTime_FromTimestamp to prevent any further regressions.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/C API/2019-02-19-08-23-42.bpo-36025.tnwylQ.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2019-02-19-08-23-42.bpo-36025.tnwylQ.rst b/Misc/NEWS.d/next/C API/2019-02-19-08-23-42.bpo-36025.tnwylQ.rst new file mode 100644 index 0000000..b00a33d --- /dev/null +++ b/Misc/NEWS.d/next/C API/2019-02-19-08-23-42.bpo-36025.tnwylQ.rst @@ -0,0 +1,5 @@ +Fixed an accidental change to the datetime C API where the arguments to the +:c:func:`PyDate_FromTimestamp` function were incorrectly interpreted as a +single timestamp rather than an arguments tuple, which causes existing code to +start raising :exc:`TypeError`. The backwards-incompatible change was only +present in alpha releases of Python 3.8. Patch by Paul Ganssle. |