Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment:
On Sun, Jan 2, 2011 at 5:35 PM, Georg Brandl <rep...@bugs.python.org> wrote: .. > Both asctime() and ctime() fixed to remove newline no matter how many > digits the year has in r87657. I also took the liberty of making the error > messages consistent. Georg, I disagree with your solution. According to relevant standards, asctime is undefined for year > 9999. A compliant implementation can do anything in this case including not null-terminating the internal buffer. With your change, time.strftime will happily replace the first unrelated '\n' with '\0' that it will find beyond the internal buffer. I was considering raising an ValueError if '\n' is not found at 24th position, but this (or a precondition check solution) should wait until 3.3. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8013> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com