Issue 1490224: time.altzone does not include DST offset on Cygwin (original) (raw)

On Cygwin (python-2.4.1-1) time.altzone is always set equal to time.timezone.

Steps to reproduce: $ python -c 'import time; time.tzset();
print time.ctime(), time.daylight,
time.timezone, time.altzone'

Actual result (for CEST): Sun May 14 13:46:55 2006 1 -3600 -3600

Expected result: Sun May 14 13:46:55 2006 1 -3600 -7200

This causes failure of time conversions in e.g. rdiff-backup-1.1.5

The attached patch should fix this for most timezones. The function already uses the same heuristics in the (!CYGWIN && !HAVE_STRUCT_TM_TM_ZONE) case.