[New-bugs-announce] [issue14278] email.utils.localtime throws exception if time.daylight is False

Brian Jones 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)
files: localtime_fix.patch
keywords: patch
messages: 155535
nosy: Brian.Jones
priority: normal
severity: normal
status: open
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>
<http://bugs.python.org/issue14278>
_______________________________________


More information about the New-bugs-announce mailing list