[Mailman-Users] question about config_list

charlie derr cderr at simons-rock.edu
Sat Apr 19 01:48:34 CEST 2008


Mark Sapiro wrote:
> charlie derr wrote:
> 
>> ... when I try to use this generated config file with 'config_list -i' somehow the 
>> floating point value gets truncated (in a very pythonic way -- no rounding up) to an integer (though it still retains the floating 
>> point notation).
> 
> 
> There appears to be a bug in the validation of numeric values which
> causes any floating point value of a 'standard' list attribute to be
> replaced by int(value). This only affects bounce_score_threshold as
> that is the only 'standard' list attribute which is a floating point
> value. It also only affects config_list because of the way in which
> config_list processes it's input.
> 
> Note that you can work around this by using
> 
> bounce_score_threshold = '0.75'
> 
> instead of
> 
> bounce_score_threshold = 0.75
> 
> in the input file to config_list. If the value is a string, the numeric
> validatation code will work as intended and return the correct
> floating point value.
> 

Hah, I *almost* tried that on a hunch, but then wasn't able to build a mental model where casting to a string would ever be 
productive (when the end goal is a floating point value).  Just goes to show you that sometimes it's probably better to think less 
and stick with the hunch.  :-]

> 
>> I discovered that I didn't actually need a floating point value there (1.0 was just as good as 0.75 for my 
>> purposes, so I simply used that), but since the documentation claims that a floating point value is acceptable, this seemed worth 
>> reporting.
> 
> 
> Yes. As you discovered, a threshold of 1.0 is as good as 0.75, but this
> is a bug and thanks for the report.
> 

Thanks very much for the detailed info and explanation,
	~c



More information about the Mailman-Users mailing list