> 1. initialize replace with None > > > if replace: > > use this instead: > if replace is not None: > > and have fun progamming python! > chris It was the source of the problem. Feel free to download the code (GPL) if you need it at ftp://www.slhan.org/source/magic.tar.gz Thomas