When a view has an invalid attrs Koo raises an "TypeError: globals must be a dict" instead
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KDE OpenObject Client |
New
|
Undecided
|
Unassigned |
Bug Description
When a view has a field with an invalid attrs tag, a stacktrace like this is shown:
---
File "/usr/local/
attributeCh
TypeError: globals must be a dict
---
This exception should be shown instead:
---
File "/usr/local/
attributeCh
File "<string>", line 1
{'readonly'
SyntaxError: invalid syntax
---
The problem is that if the evaluation of the attrs fails, then Koo retries it passing the value of the field as a parameter to the eval function. This is not correct! A dict should be passed instead to eval!
Currently:
---
try:
attributeCh
except:
attributeCh
---
Should be:
---
try:
attributeCh
except:
attributeCh
---
(Note: I noticed this bug while working on invalid bug 562881)