From: W. Trevor King Date: Sun, 27 May 2012 11:48:11 +0000 (-0400) Subject: Allow lowercase letters in percent-escapes. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58b1225f582f25a70fd42943d0802f7d387bdf96;p=pyassuan.git Allow lowercase letters in percent-escapes. I got `SETQUALITYBAR Quality%3a` from gpg-agent 2.0.17. --- 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')