On Wed, Jan 13, 2010 at 2:53 PM, Bhaskar Rao <[email protected]> wrote: > Hello group, > > This is my first time with AuthKit. > I am getting this weird error out of blue. > > I got Authkit to work before, but suddenly I get these errors today. > "TypeError: not enough arguments for format string" > > Here is the stacktrace. > > Any ideas ? > > return binding(environ, logging_start_response) > File '/Library/Python/2.6/site-packages/AuthKit-0.4.5-py2.6.egg/ > authkit/authenticate/form.py', line 135 in __call__ > content = self.template(**args) % (action) > File '/Library/Python/2.6/site-packages/WebHelpers-0.6.4-py2.6.egg/ > webhelpers/html/builder.py', line 287 in __mod__ > self.error_mode))) > TypeError: not enough arguments for format string
That happens when the left side of the % operator has more "%s" than the right side has values for. The traceback shows that it is the % operator, and it has been delegated to webhelpers.html.builder, which would happen if the left side is a literal() or a tag already created by the builder. ``.__mod__`` is the method that implements "%", and can be overridden in subclasses. To troubleshoot this, we'd need to know the local variables in the bottom level of the traceback. If you can reproduce this in the interactive traceback, you can see them. The % operator has a general ambiguity because the right side can be a single value, tuple, or dict. The problem is if the single value happens to be a tuple, Python misinterprets it. That's why % formatting is being phased out on Python 3. However, this looks like the opposite, that there are too many %s on the left side and not enough values on the right. That could be a bug either in AuthKit or the builder. -- Mike Orr <[email protected]>
-- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
