Skip to content

Commit

Permalink
Fixed EncodingWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 8, 2024
1 parent 0c9f836 commit d23dcce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions jaraco/abode/devices/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import base64
import logging
import pathlib
from shutil import copyfileobj

import requests
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d23dcce

Please sign in to comment.