Allow lowercase letters in percent-escapes.
authorW. Trevor King <wking@tremily.us>
Sun, 27 May 2012 11:48:11 +0000 (07:48 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 27 May 2012 11:48:11 +0000 (07:48 -0400)
I got `SETQUALITYBAR Quality%3a` from gpg-agent 2.0.17.

pyassuan/common.py

index d3e29155cbcca23b7f04c185671d5f6fca108673..2b29648cc0169e5f279eed929ea9bd3d9116f386 100644 (file)
@@ -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')