[New-bugs-announce] [issue14278] email.utils.localtime throws exception if time.daylight is False
report at bugs.python.org
Tue Mar 13 01:14:01 CET 2012
New submission from Brian Jones <bkjones at gmail.com>:
In email.utils.localtime, there's a variable 'offset' that will only exist if time.daylight evaluates to True. If time.daylight evaluates to False, you'll get an UnboundLocalError, because 'offset' is being referenced without being assigned.
The attached patch fixes that issue, adds several tests, and also refactors an existing test containing 4-5 assertions into a test for each assertion.
components: Library (Lib)
title: email.utils.localtime throws exception if time.daylight is False
versions: Python 3.3
Added file: http://bugs.python.org/file24808/localtime_fix.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce