Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input
 

Index | Next | Previous | View Flat


noreply at sourceforge

Nov 22, 2006, 6:38 PM


Views: 370
Permalink
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

Bugs item #1601501, was opened at 2006-11-23 02:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1601501&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: bazwal (bazwal)
Assigned to: Nobody/Anonymous (nobody)
Summary: utf_8_sig decode fails with buffer input

Initial Comment:
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:



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1601501&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Subject User Time
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input noreply at sourceforge Nov 22, 2006, 6:38 PM
    [ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input noreply at sourceforge Nov 22, 2006, 8:00 PM
    [ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input noreply at sourceforge Nov 22, 2006, 9:04 PM
    [ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input noreply at sourceforge Nov 22, 2006, 9:05 PM
    [ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input noreply at sourceforge Nov 22, 2006, 9:06 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.