From: SourceForge.net <no...@so...> - 2010-09-16 05:07:13
|
Bugs item #3065838, was opened at 2010-09-14 12:36 Message generated for change (Comment added) made by a1s You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=746843&aid=3065838&group_id=140566 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: jno (jno-) Assigned to: Nobody/Anonymous (nobody) Summary: Y2K problem proving Initial Comment: I have a government-provided (read as "unfixable") application (sample DBF is attached) where anyone can see year "1909" using the module. I afraid, that two-digit wrapping is NOT performed by time.strptime in 2.6.5. ---------------------------------------------------------------------- >Comment By: alexander smishlajev (a1s) Date: 2010-09-16 08:07 Message: fixed in cvs ---------------------------------------------------------------------- Comment By: jno (jno-) Date: 2010-09-15 21:22 Message: Sorry for being unclear :( ---------------------------------------------------------------------- Comment By: alexander smishlajev (a1s) Date: 2010-09-15 20:55 Message: ah! why didn't you say that the problem is with the DBF header? i would never guessed: i use OS file timestamps for that purposes. well, according to specs the interval for the last update field is 1900-2155. but i agree that y2k-folding may be done around year 70 there. ---------------------------------------------------------------------- Comment By: jno (jno-) Date: 2010-09-15 15:35 Message: from dbfpy import dbf db = dbf.Dbf('SOCRBASE.DBF') print db.header # this code gives me: Version (signature): 0x03 Last update: 1909-08-25 Header length: 161 Record length: 48 Record count: 143 FieldName Type Len Dec LEVEL C 5 0 SCNAME C 10 0 SOCRNAME C 29 0 KOD_T_ST C 3 0 ---------------------------------------------------------------------- Comment By: alexander smishlajev (a1s) Date: 2010-09-15 07:19 Message: > sample DBF is attached) where anyone can see year "1909" using the module. the attached file contains neither date nor datetime fields. > I afraid, that two-digit wrapping is NOT performed by time.strptime in 2.6.5. Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.strptime("090807", "%y%m%d") time.struct_time(tm_year=2009, tm_mon=8, tm_mday=7, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=219, tm_isdst=-1) >>> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=746843&aid=3065838&group_id=140566 |