Author: tack
Date: Tue Sep 25 10:47:32 2007
New Revision: 2840

Log:
Fix for exception when updating object that has an attribute of string type
that is ATTR_INVERTED_INDEX.


Modified:
   trunk/base/src/db.py

Modified: trunk/base/src/db.py
==============================================================================
--- trunk/base/src/db.py        (original)
+++ trunk/base/src/db.py        Tue Sep 25 10:47:32 2007
@@ -959,6 +959,12 @@
             terms_list = []
             for name, (attr_type, flags, attr_ivtidx, attr_split) in 
type_attrs.items():
                 if attr_ivtidx == ivtidx and name in attrs:
+                    if attr_type == str and type(attrs[name]) == buffer:
+                        # We store string objects in the db as buffers, in
+                        # order to prevent any unicode issues.  So we need
+                        # to convert the buffer we got from the db back to
+                        # a string before parsing the attribute into terms.
+                        attrs[name] = str(attrs[name])
                     terms_list.append((attrs[name], 1.0, attr_split or split, 
ivtidx))
 
             if ivtidx in attrs and ivtidx not in type_attrs:

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to