[Python-checkins] bpo-39502: Fix 64-bit Python PyTime_localtime() on AIX (GH-18285)
Michael Felt
webhook-mailer at python.org
Fri Feb 7 12:56:21 EST 2020
https://github.com/python/cpython/commit/de6f38db4859f7b8fe4da4556f06c52675fff24a
commit: de6f38db4859f7b8fe4da4556f06c52675fff24a
branch: master
author: Michael Felt <aixtools at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020年02月07日T18:56:16+01:00
summary:
bpo-39502: Fix 64-bit Python PyTime_localtime() on AIX (GH-18285)
Fix time.localtime() on 64-bit AIX to support years before 1902 and after 2038.
files:
A Misc/NEWS.d/next/Core and Builtins/2020-01-30-14-36-31.bpo-39502.IJu0rl.rst
M Python/pytime.c
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-01-30-14-36-31.bpo-39502.IJu0rl.rst b/Misc/NEWS.d/next/Core and Builtins/2020-01-30-14-36-31.bpo-39502.IJu0rl.rst
new file mode 100644
index 0000000000000..93b3639c80c5b
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-01-30-14-36-31.bpo-39502.IJu0rl.rst
@@ -0,0 +1,2 @@
+Fix :func:`time.localtime` on 64-bit AIX to support years before 1902 and after 2038.
+Patch by M Felt.
diff --git a/Python/pytime.c b/Python/pytime.c
index 54ddfc952b817..9b2b74af5c043 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -1059,7 +1059,7 @@ _PyTime_localtime(time_t t, struct tm *tm)
return 0;
#else /* !MS_WINDOWS */
-#ifdef _AIX
+#if defined(_AIX) && (SIZEOF_TIME_T < 8)
/* bpo-34373: AIX does not return NULL if t is too small or too large */
if (t < -2145916800 /* 1902年01月01日 */
|| t > 2145916800 /* 2038年01月01日 */) {
More information about the Python-checkins
mailing list