durusmail: quixote-users: Quixote changing object type, from list to _QuoteWrapper
Quixote changing object type, from list to _QuoteWrapper
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
Quixote changing object type, from list to _QuoteWrapper
Neil Schemenauer
2003-01-27
On Mon, Jan 27, 2003 at 06:14:15PM +0100, Nicola Larosa wrote:
> And why does interface["services"] become (part of) an htmltext object? It's
> a list, not a string, after all. The other fields in the "interface" dict
> are left well alone, only "bgColor" is converted to htmltext, and rightly
> so, since it's computed dinamically.
>
> This smells trouble. :^)

Nicola, thanks for sending me the code.  I found a bug in the Python
implementation of the htmltext object.  The fix is attached.  Thanks for
finding it.  It would have been quite embarrassing to have it in the 0.6
release.  I think the fix will solve all your troubles. :-)

  Neil


Index: _py_htmltext.py
===================================================================
--- _py_htmltext.py     (revision 20350)
+++ _py_htmltext.py     (working copy)
@@ -98,8 +98,10 @@
         if usedict:
             if not hasattr(args, "items"):
                 raise TypeError, "mapping required"
+            wrapped_args = {}
             for (k, v) in args.items():
-                args[k] = wraparg(v)
+                wrapped_args[k] = wraparg(v)
+            args = wrapped_args
         else:
             if len(codes) == 1 and not isinstance(args, TupleType):
                 args = (args,)

reply