[pywin32-bugs] [ pywin32-Patches-873846 ] Fix PyTime.Format (null pointer error)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2004-03-02 07:35:37
|
Patches item #873846, was opened at 2004-01-09 17:58 Message generated for change (Comment added) made by davidfraser You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=873846&group_id=78018 Category: None Group: None Status: Open Resolution: None >Priority: 9 Submitted By: David Fraser (davidfraser) >Assigned to: Mark Hammond (mhammond) Summary: Fix PyTime.Format (null pointer error) Initial Comment: PyTime.Format currently crashes with a null pointer exception on times before 1970. (pywintypes.Time(x) where x < -1) In Patch 808465 I submitted a change to PyTime.Format that used mktime and localtime to generate the day of week and day of year since day of year is not included in the SYSTEMTIME struct. This can crash because if the time is before 1970 (e.g. pywintypes.Time(-10)) then mktime returns -1 and localtime returns NULL. This is a patch that rather does the calculations properly (they are just numeric). I took the code directly from the Python 2.3 datetime module and merged in the required functions. The resulting code is therefore simple and more reliable. ---------------------------------------------------------------------- >Comment By: David Fraser (davidfraser) Date: 2004-03-02 09:30 Message: Logged In: YES user_id=221678 Changing priority - this should be fixed soon! There is a test to demonstrate it in bug 873847 ---------------------------------------------------------------------- Comment By: David Fraser (davidfraser) Date: 2004-01-19 16:14 Message: Logged In: YES user_id=221678 fixes a crash, so should be applied soon ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=873846&group_id=78018 |