]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Fix lexer bug with handling of invalid escaping
authorMenno Smits <menno@freshfoo.com>
Mon, 30 Jun 2014 12:01:44 +0000 (00:01 +1200)
committerMenno Smits <menno@freshfoo.com>
Mon, 30 Jun 2014 12:01:44 +0000 (00:01 +1200)
imapclient/response_lexer.py

index 9432e8ca8a43ea4a13ece8942cef913977279a7c..25e715403f9e9080b9a061eb18ec083f270739cb 100644 (file)
@@ -67,7 +67,7 @@ class Lexer(object):
                     escaper = nextchar
                     nextchar = six.next(stream_i)
                     if nextchar != escaper and nextchar != end_char:
-                        token += escaper.decode
+                        nextchar = escaper + nextchar    # Don't touch invalid escaping
                 elif nextchar == end_char:
                     break
                 token += nextchar