[issue10563] Spurious newline in time.ctime

2011-01-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: This has now been superseded by the changes made for issue #8013. -- nosy: +georg.brandl resolution: - out of date status: open - closed superseder: - time.asctime segfaults when given a time in the far future

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
New submission from Gerrit Holl topjakl...@gmail.com: When the time passed to time.ctime is large, it adds a newline: import time time.ctime(236) 'Wed Apr 8 17:04:32 6325' time.ctime(237) 'Wed Jul 14 08:09:04 10680\n' -- components: Library (Lib) messages: 122665 nosy: Gerrit.Holl

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: There's an error in time_ctime where it expects the length of the string to be fixed: if (p[24] == '\n') p[24] = '\0'; It doesn't count on the year having 5 digits. It should probably say (untested): l = len(p); if (l 0

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: That should be strlen(), of course. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: What platform are you running this on? My Fedora 32 bit system won't support a time_t that large. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
Gerrit Holl topjakl...@gmail.com added the comment: I'm on a 64bit system (kubuntu lucid lynx) $ uname -a Linux sjisjka 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux -- ___ Python tracker rep...@bugs.python.org

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Can you try this diff and see if it solves the problem: Index: Modules/timemodule.c === --- Modules/timemodule.c(revision 86848) +++ Modules/timemodule.c(working

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
Gerrit Holl topjakl...@gmail.com added the comment: Yes, this solves the issue: $ ./python Python 3.1.3 (r313:86834, Nov 28 2010, 17:34:23) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. import time time.ctime(240) 'Fri Apr 10 03:12:32 71654'

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- components: +Extension Modules -Library (Lib) keywords: +easy, patch stage: - unit test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: This looks like a bug in the underlying platform. POSIX requires [1] that the output of ctime() fits in a 26-character buffer. Note that a change has been recently made to time.asctime() to reject year . See r85137

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- assignee: - belopolsky stage: unit test needed - needs patch type: - feature request versions: +Python 3.2 -Python 2.6, Python 2.7, Python 3.1 ___ Python tracker