[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-05 Thread STINNER Victor
STINNER Victor added the comment: Ok, it's now fixed. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset eeadf5fc231163ec97a8010754d9c995c7c14876 by Victor Stinner in branch '2.7': bpo-31339: Rewrite time.asctime() and time.ctime() (#3293) https://github.com/python/cpython/commit/eeadf5fc231163ec97a8010754d9c995c7c14876 --

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-05 Thread STINNER Victor
STINNER Victor added the comment: > Isn't this a duplicate of issue16137 which was closed with the resolution > "won't fix"? This issue seems to be a crash on Windows using negative year. You proposed a patch using asctime_s() instead of asctime(). So the fix is specific to Windows. This

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't this a duplicate of issue16137 which was closed with the resolution "won't fix"? -- nosy: +belopolsky, benjamin.peterson ___ Python tracker

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor
STINNER Victor added the comment: Christian Heimes: "I'm ok to replace the asctime with our own implementation that can handle year >. Please include range checks for year, wday and month, though." Done. By the way, I discussed with Alex Gaynor on #python-dev to define the severity of

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor
STINNER Victor added the comment: Ok, there are 3 choices: * Do nothing: musl crash on year > , glibc supports year > , behaviour is likely undefined on other libc * PR 3296: Reject year > on all platforms: can be seen as a Python 2.7 regression when running with glibc * PR 3293:

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread Christian Heimes
Christian Heimes added the comment: I'm ok to replace the asctime with our own implementation that can handle year >. Please include range checks for year, wday and month, though. -- nosy: +christian.heimes ___ Python tracker

[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot to describe the bug. asctime() (and ctime()?) do crash on year > with musl. musl uses an hardcoded buffer of 26 bytes: http://git.musl-libc.org/cgit/musl/tree/src/time/__asctime.c musl developers consider that the caller must reject year