email.Utils.formatdate documentation does not mention that
'usegmt' keyword argument is new on Python 2.4.
reference:
http://python.org/doc/2.4.1/lib/module-email.Utils.html
http://python.org/doc/2.3.5/lib/module-email.Utils.html
I don't know if its the rule, but usually the docs warn about new
additions, and its very important when you try to create code that
should work on multiple Python versions.
Suggested fix
replace:
"Optional usegmt is a flag that when True, outputs a date string with
the timezone as an ascii string GMT, rather than a numeric -0000.
This is needed for some protocols (such as HTTP). This only applies
when localtime is False"
with:
"Optional usegmt is a flag that when True, outputs a date string with
the timezone as an ascii string GMT, rather than a numeric -0000.
This is needed for some protocols (such as HTTP). This only applies
when localtime is False. New in Python 2.4."
|