jinja2 instead string.Template, file open mode pass as parameter