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

Mailing List Archive: Python: Bugs

[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


noreply at sourceforge

Nov 22, 2006, 6:38 PM

Post #1 of 5 (563 views)
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


noreply at sourceforge

Nov 22, 2006, 8:00 PM

Post #2 of 5 (543 views)
Permalink
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input [In reply to]

Bugs item #1601501, was opened at 2006-11-23 03:38
Message generated for change (Comment added) made by doerwalter
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:



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

>Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 05:00

Message:
Logged In: YES
user_id=89016
Originator: NO

Can you provide a test that fails?

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

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


noreply at sourceforge

Nov 22, 2006, 9:04 PM

Post #3 of 5 (525 views)
Permalink
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input [In reply to]

Bugs item #1601501, was opened at 2006-11-23 03:38
Message generated for change (Comment added) made by doerwalter
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:



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

>Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 06:04

Message:
Logged In: YES
user_id=89016
Originator: NO

Oops, I missed your stacktrace. Fixed in r52826.

(A better fix might be to add startswith() to buffer).

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

Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 05:00

Message:
Logged In: YES
user_id=89016
Originator: NO

Can you provide a test that fails?

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

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


noreply at sourceforge

Nov 22, 2006, 9:05 PM

Post #4 of 5 (548 views)
Permalink
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input [In reply to]

Bugs item #1601501, was opened at 2006-11-23 03:38
Message generated for change (Settings changed) made by doerwalter
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: Accepted
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:



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

Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 06:04

Message:
Logged In: YES
user_id=89016
Originator: NO

Oops, I missed your stacktrace. Fixed in r52826.

(A better fix might be to add startswith() to buffer).

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

Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 05:00

Message:
Logged In: YES
user_id=89016
Originator: NO

Can you provide a test that fails?

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

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


noreply at sourceforge

Nov 22, 2006, 9:06 PM

Post #5 of 5 (528 views)
Permalink
[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input [In reply to]

Bugs item #1601501, was opened at 2006-11-23 03:38
Message generated for change (Comment added) made by doerwalter
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: Closed
Resolution: Accepted
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:



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

>Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 06:06

Message:
Logged In: YES
user_id=89016
Originator: NO

Fixed in r52827 for the 2.5 branch

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

Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 06:04

Message:
Logged In: YES
user_id=89016
Originator: NO

Oops, I missed your stacktrace. Fixed in r52826.

(A better fix might be to add startswith() to buffer).

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

Comment By: Walter Dörwald (doerwalter)
Date: 2006-11-23 05:00

Message:
Logged In: YES
user_id=89016
Originator: NO

Can you provide a test that fails?

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

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

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.