mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-20 04:52:21 +00:00
Merge pull request #17 from overcuriousity/claude/fix-unknown-signer-y3bWG
Force English locale for GPG verify to fix localized output parsing
This commit is contained in:
@@ -43,12 +43,19 @@ class Crypto:
|
|||||||
return False, "Not a GPG signed message"
|
return False, "Not a GPG signed message"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Force English output for consistent parsing across locales
|
||||||
|
import os
|
||||||
|
env = os.environ.copy()
|
||||||
|
env['LC_ALL'] = 'C'
|
||||||
|
env['LANG'] = 'C'
|
||||||
|
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['gpg', '--verify'],
|
['gpg', '--verify'],
|
||||||
stdin=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
text=True
|
text=True,
|
||||||
|
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