comparison configmix/toml.py @ 207:b3b5ed34d180

Handle most flake8 errors and warnings. NOTE: E265 "block comment should start with '# ' ist not yet handled. We would need to adjust our Python style.
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 05 May 2019 18:29:47 +0200
parents 28e6c1413947
children bbe8513ea649
comparison
equal deleted inserted replaced
206:5064e3a2e54a 207:b3b5ed34d180
28 28
29 29
30 def load(filename, encoding="utf-8"): 30 def load(filename, encoding="utf-8"):
31 """Load a single TOML file with name `filename` and encoding `encoding`. 31 """Load a single TOML file with name `filename` and encoding `encoding`.
32 32
33 .. note:: The TOML standard requires that all TOML files are UTF-8 33 .. note:: The TOML standard requires that all TOML files are UTF-8
34 encoded. 34 encoded.
35 35
36 """ 36 """
37 with io.open(u2fs(filename), mode="rt", encoding=encoding) as tfp: 37 with io.open(u2fs(filename), mode="rt", encoding=encoding) as tfp:
38 return toml.loads(tfp.read(), _dict=DictImpl) 38 return toml.loads(tfp.read(), _dict=DictImpl)