M src/groceries/txtdb.py => src/groceries/txtdb.py +2 -2
@@ 9,13 9,13 @@ class TextFile:
self._init()
def _load(self):
- with self._path.open("r") as fh:
+ with self._path.open("r", encoding="utf-8") as fh:
items = todotxt.load(fh)
return {i.name: i for i in items}
def _write(self, items):
- with self._path.open("w") as fh:
+ with self._path.open("w", encoding="utf-8") as fh:
todotxt.dump(items, fh)
def _init(self):
M tests/conftest.py => tests/conftest.py +1 -1
@@ 23,7 23,7 @@ def items():
def groceries_file(tmpdir, items):
path = Path(tmpdir) / "groceries.txt"
- with path.open("w") as fh:
+ with path.open("w", encoding="utf-8") as fh:
todotxt.dump(items, fh)
return path