When I was merging r7800 of trunk into mozootle, some fairly rare  
circumstances involving quick-stats led to this error:

   File "/data/www/Pootle/projects.py", line 1159, in getquickstats
     self.pofiles[pofilename].statistics.updatequickstats(save=False)
TypeError: invalidate_memoization_f() got an unexpected keyword  
argument 'save'

Looking over the new memoization code, it looks like some of the  
functions that are memoized can take named arguments, but the  
memoization functions take *args as parameters.  Adding **kwargs to  
the parameters fixed the problem.

This is the result of `svn diff` after adding **kwargs:

Index: statistics.py
===================================================================
--- statistics.py (revision 7800)
+++ statistics.py (working copy)
@@ -10,18 +10,18 @@
      return None

  def memoize(f):
-  def memoized_f(self, *args):
+  def memoized_f(self, *args, **kwargs):
      f_name = f.__name__
      table = self._memoize_table
      if f_name not in table:
-      table[f_name] = f(self, *args)
+      table[f_name] = f(self, *args, **kwargs)
      return table[f_name]
    return memoized_f

  def invalidates_memoization(f):
-  def invalidate_memoization_f(self, *args):
+  def invalidate_memoization_f(self, *args, **kwargs):
      self._memoize_table = {}
-    return f(self, *args)
+    return f(self, *args, **kwargs)
    return invalidate_memoization_f

  class pootlestatistics:


Thanks,
Dan Schafer
Intern - Mozilla Corporation
[EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to