mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-01 12:02:05 +00:00
fix(xai): suppress false-positive windows-footgun on binary image read
open(..., "rb") is binary mode and needs no encoding=; the checker's regex doesn't recognize the mode. Add the documented suppression comment.
This commit is contained in:
parent
9ce79cd642
commit
5a3d7fb99d
1 changed files with 1 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ def _xai_image_field(source: str) -> Dict[str, str]:
|
|||
import base64
|
||||
import os as _os
|
||||
|
||||
with open(_os.path.expanduser(source), "rb") as fh:
|
||||
with open(_os.path.expanduser(source), "rb") as fh: # windows-footgun: ok
|
||||
raw = fh.read()
|
||||
ext = (_os.path.splitext(source)[1].lstrip(".") or "png").lower()
|
||||
if ext == "jpg":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue