diff --git a/jaraco/abode/devices/camera.py b/jaraco/abode/devices/camera.py index efbd5e2..9a532c9 100644 --- a/jaraco/abode/devices/camera.py +++ b/jaraco/abode/devices/camera.py @@ -2,6 +2,7 @@ import base64 import logging +import pathlib from shutil import copyfileobj import requests @@ -116,9 +117,7 @@ def update_image_location(self, timeline_json): def stream_details_to_file(self, details, path): """Write the stream details to a file.""" - with open(path, "w") as f: - f.write(details) - + pathlib.Path(path).write_text(details, encoding='utf-8') return True def image_to_file(self, path, get_image=True): diff --git a/tests/test_camera.py b/tests/test_camera.py index 2a32203..71325e1 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -364,4 +364,4 @@ def test_kvs_stream(self, m, tmp_path): ) device.start_kvs_stream(outfile) - assert json.loads(outfile.read_text()) == response + assert json.loads(outfile.read_text(encoding='utf-8')) == response