[toolsutils] Small fixes to fill_templated_file()
* Use context managers to close _both_ files
* Use io.open to enforce text mode on both python 2 and 3
# -*- coding: utf-8 -*-
# copyright %(year)s %(author)s, all rights reserved.
# contact %(author-web-site)s -- mailto:%(author-email)s
#
%(long-license)s
"""%(distname)s specific hooks and operations"""