fix: use encoding='utf-8' with errors='replace' for bird subprocess calls
Fixes non-UTF-8 character handling in Twitter content. Replaces text=True with explicit encoding parameters. Co-authored-by: dev-starlight <dev-starlight@users.noreply.github.com> Closes #3
This commit is contained in:
parent
fe7ed1656b
commit
31eb6db537
1 changed files with 4 additions and 2 deletions
|
|
@ -60,7 +60,8 @@ class TwitterChannel(Channel):
|
|||
async def _read_bird(self, url: str, bird: str, config=None) -> ReadResult:
|
||||
result = subprocess.run(
|
||||
[bird, "read", url],
|
||||
capture_output=True, text=True, timeout=30,
|
||||
capture_output=True, timeout=30,
|
||||
encoding='utf-8', errors='replace',
|
||||
env=_bird_env(config),
|
||||
)
|
||||
if result.returncode != 0:
|
||||
|
|
@ -147,7 +148,8 @@ class TwitterChannel(Channel):
|
|||
try:
|
||||
result = subprocess.run(
|
||||
[bird, "search", query, "-n", str(limit)],
|
||||
capture_output=True, text=True, timeout=30,
|
||||
capture_output=True, timeout=30,
|
||||
encoding='utf-8', errors='replace',
|
||||
env=_bird_env(config),
|
||||
)
|
||||
if result.returncode != 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue