[New-bugs-announce] [issue1460] codecs utf7 decoding error

Árni Már Jónsson report at bugs.python.org
Mon Nov 19 10:29:18 CET 2007

New submission from Árni Már Jónsson:

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:

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:

files: utf7.py
messages: 57629
nosy: arnimar
severity: normal
status: open
title: codecs utf7 decoding error
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file8773/utf7.py

Tracker <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utf7.py
Type: application/octet-stream
Size: 283 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071119/2cf0d705/attachment.obj 

More information about the New-bugs-announce mailing list