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 bazwal
Recipients
Date 2006-11-23.02:38:36
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
when the decode function in encodings.utf_8_sig receives a buffer object, it fails because it tries to check for a bom using startswith:

>>> unicode('\xef\xbb\xbf', 'utf_8_sig')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/encodings/utf_8_sig.py", line 19, in decode
    if input.startswith(codecs.BOM_UTF8):
AttributeError: 'buffer' object has no attribute 'startswith'

the test should be changed to:

if input[:3] == codecs.BOM_UTF8:

History
Date User Action Args
2007-08-23 14:50:13adminlinkissue1601501 messages
2007-08-23 14:50:13admincreate