Skip to content

Commit 1861ad4

Browse files
authored
Fix UnicodeDecodeError on malformed UTF-8 radio responses (#12)
1 parent f3d6ca1 commit 1861ad4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

afsapi/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async def __call(
222222
raise FSApiException(
223223
f"Unexpected result {result.status}: {await result.text()}"
224224
)
225-
doc = ET.fromstring(await result.text(encoding="utf-8"))
225+
doc = ET.fromstring(await result.text(encoding="utf-8", errors="replace"))
226226
status = unpack_xml(doc, "status")
227227

228228
if status == "FS_OK" or status == "FS_LIST_END":

0 commit comments

Comments
 (0)