[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2017-09-05 Thread STINNER Victor
STINNER Victor added the comment: This issue should be fixed by my commit eeadf5fc231163ec97a8010754d9c995c7c14876. -- ___ Python tracker ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Eryk. Sad, a simple solution doesn't help. We have returned to the old decision -- won't fix. -- stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-26 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-26 Thread Eryk Sun
Eryk Sun added the comment: To resolve the crash on Windows in 2.7 requires backporting checktm(). Using asctime_s doesn't solve the problem. The CRT still calls the default invalid parameter handler, which kills the process -- as shown by the following ctypes example: from ctypes import

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Benjamin, there is a crash, and there is a simple patch that presumably fixes a crash. I think fixing crashes has high priority. The patch is tested on Linux and needs to be tested on Windows. -- components: +Windows nosy: +paul.moore, steve.dower,

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 'Mon Jan 1 -01:00:00 2011\n' This is obviously wrong because trailing '\n' was not dropped. The issue is not about what is more wrong. The issue is about Python crash. At least we should add a warning in the documentation that incorrect data may crash

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: A new patch uses asctime_s() on Windows (this crash was observed only on Windows). This should prevent a crash. In additional it drops '\n' from a result even if the result is longer than usually (this happened on Linux when an invalid time is used).

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28958/asctime_s.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread STINNER Victor
STINNER Victor added the comment: asctime_s.patch: you should catch ValueError on each call to self.assertNotIn(). You can use PyString_FromStringAndSize() instead of writing the NUL character, it may be safer (to not modify the output of asctime). 2013/2/5 Serhiy Storchaka

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for comments, Victor. Here is an updated patch. -- Added file: http://bugs.python.org/file28963/asctime_s_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Benjamin, I am assigning this to you because 2.7.4 release is probably the last chance to do something about this behavior in 2.7 series. I am tentatively resolving this as won't fix. In 3.x, we decided that well defined behavior is more important

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: This is long behavior standing, which we can leave in 2.x. -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Any news? -- priority: normal - critical ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___ ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which includes backported issue6608 and issue8013. This should fix this crash. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file28034/asctime.patch ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I recall a discussion in which it was argued that look before you leap-style argument checking that we implemented in py3k was a feature and backporting it to 2.x could potentially break code running on platforms with promiscuous (and possibly buggy)

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Alexander, do you want to backport r87736 to 2.7? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Alexander, looks as you changes in r87736 was not backported to 2.7. -- components: +Extension Modules -Library (Lib) nosy: +belopolsky stage: - needs patch ___ Python tracker rep...@bugs.python.org

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread Mark Lawrence
Mark Lawrence added the comment: I can reproduce this on Windows Vista running 2.7.3. With 3.3.0 I get faulty_time = time.asctime(initial_struct_time) Traceback (most recent call last): File stdin, line 1, in module TypeError: Tuple or struct_time argument required -- nosy:

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Viktor, what happen when a large positive number (=100) used as tm_hour? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread Viktor Chynarov
Viktor Chynarov added the comment: Serhiy, when I use a large number, Python also crashes. initial_struct_time = [tm for tm in time.localtime()] initial_struct_time[3] = 101 faulty_time = time.asctime(initial_struct_time) The above code leads to crash. My Python version information and

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it looks as issue8013. Fix was not applied to 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread R. David Murray
R. David Murray added the comment: This sounds like Issue 10814, but that was supposedly fixed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread R. David Murray
R. David Murray added the comment: Ah, looks like Serhiy found the correct issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___ ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, it's you found (msg172016) the correct issue. ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-04 Thread Viktor Chynarov
New submission from Viktor Chynarov: If a that has a negative tm_hour is passed as an argument to time.asctime(), Python crashes. initial_struct_time = [tm for tm in time.localtime()] initial_struct_time[3] = -1 faulty_time = time.asctime(initial_struct_time) -- components:

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-04 Thread Viktor Chynarov
Viktor Chynarov added the comment: If an array created from a struct_time that has a negative tm_hour is passed as an argument to time.asctime(), Python crashes. initial_struct_time = [tm for tm in time.localtime()] initial_struct_time[3] = -1 faulty_time =

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-04 Thread R. David Murray
R. David Murray added the comment: I can't reproduce this. What version of 2.7? (This might have been fixed by the issue 8013 fix). -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-10-04 Thread Kushal Das
Kushal Das added the comment: Can not reproduce this on 2.7.3 on Fedora 17, x86_64. -- nosy: +kushaldas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16137 ___