[Python-checkins] cpython (merge 3.3 -> default): (Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999

victor.stinner python-checkins at python.org
Tue Jun 25 02:34:43 CEST 2013


http://hg.python.org/cpython/rev/b78648c6603e
changeset:   84337:b78648c6603e
parent:      84334:28f47a5d59b9
parent:      84336:5bf5c461ec00
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Jun 25 02:34:13 2013 +0200
summary:
  (Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999

time.strtime("%Y") returned "2345" when formatting year 12345.

files:
  Modules/timemodule.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/timemodule.c b/Modules/timemodule.c
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -598,7 +598,7 @@
     else if (!gettmarg(tup, &buf) || !checktm(&buf))
         return NULL;
 
-#if defined(_MSC_VER) || defined(sun)
+#if defined(_MSC_VER) || defined(sun) || defined(_AIX)
     if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
         PyErr_SetString(PyExc_ValueError,
                         "strftime() requires year in [1; 9999]");

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list