1.1 --- a/moinformat/input/common.py Sun Jul 07 23:46:21 2019 +0200
1.2 +++ b/moinformat/input/common.py Fri Jul 12 21:54:20 2019 +0200
1.3 @@ -19,6 +19,7 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from moinformat.utils.file import readfile
1.8 from os.path import split
1.9 import codecs
1.10
1.11 @@ -99,11 +100,7 @@
1.12 optional 'encoding' is specified, override the general encoding.
1.13 """
1.14
1.15 - f = codecs.open(filename, encoding=encoding or self.encoding)
1.16 - try:
1.17 - return f.read()
1.18 - finally:
1.19 - f.close()
1.20 + return readfile(filename, encoding or self.encoding)
1.21
1.22 # Name translation methods.
1.23