Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1692 (closed defect: fixed)

Opened 11 years ago

Last modified 9 years ago

Bug in ToscaWidgets-0.2rc3dev_r3795

Reported by: dbrattli Owned by: alberto
Priority: normal Milestone: irrespective
Component: ToscaWidgets Version: trunk
Severity: blocker Keywords:


The doc collector (_make_params_docs) in meta.py for the latest ToscaWidgets? cannot handle class attributes that are of type tuple. It will give the following exception:

  File "/Library/Python/2.5/site-packages/ToscaWidgets-0.2rc3dev_r3795-py2.5.egg/toscawidgets/meta.py", line 23, in __new__
    _make_params_docs(new, params)
  File "/Library/Python/2.5/site-packages/ToscaWidgets-0.2rc3dev_r3795-py2.5.egg/toscawidgets/meta.py", line 119, in _make_params_docs
    default = " (*default* = %r)" % getattr(cls, name)
TypeError: not all arguments converted during string formatting

This is because tuples have a special meaning when used with the interpolation operator %, and its applied before the repr() of %r. Thus in order to fix the bug one have to call repr() before %.

py2.5.egg/toscawidgets [dag]: diff -urN meta.py.orig meta.py
--- meta.py.orig	2008-01-16 17:45:24.000000000 +0100
+++ meta.py	2008-01-16 17:45:34.000000000 +0100
@@ -116,7 +116,7 @@
         # Get the default value.
-            default = " (*default* = %r)" % getattr(cls, name)
+            default = " (*default* = %s)" % repr(getattr(cls, name))
         except AttributeError:
             default = ""

-- Dag

Change History

comment:1 Changed 11 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Fixed is [4009]. Thanks!


comment:2 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to irrespective
Note: See TracTickets for help on using tickets.