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:
overcuriousity
2025-12-14 14:56:49 +01:00
committed by GitHub

View File

@@ -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)