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 arnimar
Recipients arnimar
Date 2007-11-19.09:29:16
SpamBayes Score 0.02865888
Marked as misclassified No
Message-id <1195464558.65.0.820353840757.issue1460@psf.upfronthosting.co.za>
In-reply-to
Content
There is a utf-7 decoding error when decoding strings which have a shift
sequence at a certain place. To reproduce run the attached program on a
file containing the string:
"0123456789012345678901234567890123456789012345678901234567890123456789X+-".

The shift sequence starts at character 72. The culprit seems to be in
codecs.py: StreamReader.read. The input is split on the 72 character
boundary, and the first decode call raises an exception since the shift
sequence is not terminated. The second one falls back 1 character,
raises no exception, but the previous exception is raised since there is
no newline in the output (?).

The lines I don't understand are, and are the ones raising the exception.

if len(lines)<=1:
  raise
Files
File name Uploaded
utf7.py arnimar, 2007-11-19.09:29:17
History
Date User Action Args
2007-11-19 09:29:19arnimarsetspambayes_score: 0.0286589 -> 0.02865888
recipients: + arnimar
2007-11-19 09:29:18arnimarsetspambayes_score: 0.0286589 -> 0.0286589
messageid: <1195464558.65.0.820353840757.issue1460@psf.upfronthosting.co.za>
2007-11-19 09:29:18arnimarlinkissue1460 messages
2007-11-19 09:29:17arnimarcreate