Why not simply
```
match = re.match('\s*download.transfer_timeout\s*=\s*(\d+)', line)
if match:
  timeoutstr = "&timeout=%d" % (int(match.group(1))) 
```
instead of Salamitaktik (and matching prefix only).