lizardsystem/lizard-waterbalance — Issue #26: BaseModel.__getattr__ returns an incorrect error message when the attribute is missing
Author: swinkels
Created: 2011-11-16 14:55:42+00:00
State: open

If you call method `retrieve_precipitation` of a BaseModel and no precipitation has been found, you get a stack trace such as the following:

Traceback (most recent call last):
File "bin/wbcompute", line 45, in
xmlmodel.wbcompute.main(sys.argv[1:])
File "/home/pieter/github.com/krw-waternet/src/lizard-waterbalance/xmlmodel/wbcompute.py", line 128, in main
print area.retrieve_precipitation
File "/home/pieter/github.com/krw-waternet/src/lizard-waterbalance/xmlmodel/reader.py", line 61, in __getattr__
return object.__getattr__(self, attr)
AttributeError: type object 'object' has no attribute '__getattr__'

The `AttributeError` is correct but the corresponding message is not. The message should state something like

type object 'BaseModel' has no attribute 'retrieve_precipitation'