Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/__init__.py @ 166:b5ce9a8461bf
Use the filesystem encoding explicitely where appropriate.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 14 Mar 2019 01:35:16 +0100 |
| parents | 6ca90e80f4f4 |
| children | d8155c429171 |
comparison
equal
deleted
inserted
replaced
| 165:6ca90e80f4f4 | 166:b5ce9a8461bf |
|---|---|
| 19 __date__ = "|VCSJustDate|" | 19 __date__ = "|VCSJustDate|" |
| 20 | 20 |
| 21 | 21 |
| 22 import copy | 22 import copy |
| 23 | 23 |
| 24 from .compat import u | 24 from .compat import u, u2fs |
| 25 from .config import Configuration | 25 from .config import Configuration |
| 26 | 26 |
| 27 | 27 |
| 28 __all__ = ["load", "safe_load", | 28 __all__ = ["load", "safe_load", |
| 29 "set_loader", "default_loaders", | 29 "set_loader", "default_loaders", |
| 71 return Configuration(ex) | 71 return Configuration(ex) |
| 72 | 72 |
| 73 | 73 |
| 74 def _load_yaml(filename): | 74 def _load_yaml(filename): |
| 75 from . import yaml | 75 from . import yaml |
| 76 with open(filename, "rb") as yf: | 76 with open(u2fs(filename), "rb") as yf: |
| 77 return yaml.safe_load(yf) | 77 return yaml.safe_load(yf) |
| 78 | 78 |
| 79 | 79 |
| 80 def _load_json(filename): | 80 def _load_json(filename): |
| 81 from . import json | 81 from . import json |
