From 5a3d7fb99d1f23d3156e17575cabc664fc7fe593 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:47:25 -0700 Subject: [PATCH] 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. --- plugins/image_gen/xai/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/image_gen/xai/__init__.py b/plugins/image_gen/xai/__init__.py index a611a0aa031..31a0b719bb6 100644 --- a/plugins/image_gen/xai/__init__.py +++ b/plugins/image_gen/xai/__init__.py @@ -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":