lsm / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Crash and odd results from calls to time module on WinXP #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following code identifies two things that I have seen when using Python's 
time module:

import time
print time.localtime()
print time.asctime()

On WinXP and Python 2.6, I get the expected output:

time.struct_time(tm_year=2012, tm_mon=9, tm_mday=21, tm_hour=11, tm_min=11, 
tm_sec=45, tm_wday=4, tm_yday=265, tm_isdst=1)

Fri Sep 21 11:11:45 2012

After compilation with Shedskin 0.9.2-2, only time.localtime() is printed 
before a crash occurs with time.asctime(). And the time associated with 
.localtime() is off. I see the following:

time.struct_time(tm_year=1969, tm_mon=12, tm_mday=31, tm_hour=16, tm_min=0, 
tm_sec=0, tm_wday=2, tm_yday=365, tm_isdst=0)

Just mentioning it. It is nice to be able to periodically report progress times 
of long-running programs using the time module, but it is by no means 
completely necessary for me at this stage.

Original issue reported on code.google.com by MarkPerr...@gmail.com on 21 Sep 2012 at 6:19

GoogleCodeExporter commented 9 years ago
thanks a lot for reporting! apparently this was broken on all platforms, 
because of some recent refactoring combined with a lack of tests for calls to 
these functions without arguments.. so I fixed the problem and added some 
tests. thanks again, and please report any other problems you may run into!

Original comment by mark.duf...@gmail.com on 22 Sep 2012 at 2:55