This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pfalcon
Recipients pfalcon
Date 2014-05-15.16:37:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400171855.37.0.067918723363.issue21511@psf.upfronthosting.co.za>
In-reply-to
Content
Lib/quopri.py for version 3.3..3.5-tip contains following code:

ESCAPE = b'='
...
        line = input.readline()
        if not line: break
        i, n = 0, len(line)
        if n > 0 and line[n-1:n] == b'\n':
...
            elif i+1 < n and line[i+1] == ESCAPE:


So, ESCAPE is defined as bytes, we see that "line" is read as bytes, and characters are accessed using idiom like "line[n-1:n]", but then it uses "line[i+1]", which returns int and thus will never be equal to ESCAPE.

I'm not sure what exact semantic condition that branch represents, for me it looks like "==" sequence to be decoded as "=". But I don't see such encoding variant in http://en.wikipedia.org/wiki/Quoted-printable . Either way, replacing that condition with "and False", still passes test_quopri.py
History
Date User Action Args
2014-05-15 16:37:35pfalconsetrecipients: + pfalcon
2014-05-15 16:37:35pfalconsetmessageid: <1400171855.37.0.067918723363.issue21511@psf.upfronthosting.co.za>
2014-05-15 16:37:35pfalconlinkissue21511 messages
2014-05-15 16:37:34pfalconcreate