mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-20 21:12:22 +00:00
Merge pull request #18 from overcuriousity/claude/fix-unknown-signer-y3bWG
Fix UTF-8 decoding error when verifying signatures with international…
This commit is contained in:
@@ -46,8 +46,8 @@ class Crypto:
|
|||||||
# Force English output for consistent parsing across locales
|
# Force English output for consistent parsing across locales
|
||||||
import os
|
import os
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['LC_ALL'] = 'C'
|
env['LC_ALL'] = 'C.UTF-8' # Use UTF-8 variant to handle international characters
|
||||||
env['LANG'] = 'C'
|
env['LANG'] = 'C.UTF-8'
|
||||||
|
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['gpg', '--verify'],
|
['gpg', '--verify'],
|
||||||
@@ -55,6 +55,8 @@ class Crypto:
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding='utf-8',
|
||||||
|
errors='replace', # Replace invalid UTF-8 sequences instead of crashing
|
||||||
env=env
|
env=env
|
||||||
)
|
)
|
||||||
stdout, stderr = proc.communicate(input=signed_content, timeout=10)
|
stdout, stderr = proc.communicate(input=signed_content, timeout=10)
|
||||||
|
|||||||
Reference in New Issue
Block a user