From 58b1225f582f25a70fd42943d0802f7d387bdf96 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 27 May 2012 07:48:11 -0400 Subject: [PATCH] Allow lowercase letters in percent-escapes. I got `SETQUALITYBAR Quality%3a` from gpg-agent 2.0.17. --- pyassuan/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyassuan/common.py b/pyassuan/common.py index d3e2915..2b29648 100644 --- a/pyassuan/common.py +++ b/pyassuan/common.py @@ -28,8 +28,8 @@ LINE_LENGTH = 1002 # 1000 + [CR,]LF _ENCODE_PATTERN = '(' + '|'.join(['%', '\r', '\n']) + ')' _ENCODE_STR_REGEXP = _re.compile(_ENCODE_PATTERN) _ENCODE_BYTE_REGEXP = _re.compile(_ENCODE_PATTERN.encode('ascii')) -_DECODE_STR_REGEXP = _re.compile('(%[0-9A-F]{2})') -_DECODE_BYTE_REGEXP = _re.compile(b'(%[0-9A-F]{2})') +_DECODE_STR_REGEXP = _re.compile('(%[0-9A-Fa-f]{2})') +_DECODE_BYTE_REGEXP = _re.compile(b'(%[0-9A-Fa-f]{2})') _REQUEST_REGEXP = _re.compile('^(\w+)( *)(.*)\Z') -- 2.26.2