re.sub(luser, repl, config)
could be replaced by
config.replace(luser, repl)
as luser is not a regular expression, but both versions will do the job just fine.
re.sub(luser, repl, config)
could be replaced by
config. replace( luser, repl)
as luser is not a regular expression, but both versions will do the job just fine.