﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
207	TimeFormat seconds function has unused second argument (w/ patch)	Mathieu Fenniak <mfenniak@…>	Adrian Holovaty	"When using a time format with the 's' format string, which should be the time's seconds with leading zeros, the following error occurs:

{{{
  File ""/usr/lib/python2.3/site-packages/django/core/defaultfilters.py"", line 329, in time
    return time_format(value, arg)

  File ""/usr/lib/python2.3/site-packages/django/utils/dateformat.py"", line 317, in time_format
    return tf.format(format_string)

  File ""/usr/lib/python2.3/site-packages/django/utils/dateformat.py"", line 304, in format
    result += str(getattr(self, char)())

TypeError: s() takes exactly 2 arguments (1 given)
}}}

It seems that the TimeFormat's {{{s}}} function has an unnecessary and harmful second argument that is never used.  This simple patch addresses the problem:

{{{
Index: django/utils/dateformat.py
===================================================================
--- django/utils/dateformat.py  (revision 312)
+++ django/utils/dateformat.py  (working copy)
@@ -293,7 +293,7 @@
             return 'noon'
         return '%s %s' % (self.f(), self.a())
 
-    def s(self, s):
+    def s(self):
         ""Seconds; i.e. '00' to '59'""
         return '%02d' % self.time.second
}}}"	defect	closed	Template system		normal	fixed			Unreviewed	0	0	0	0	0	0
