Ezio Melotti <ezio.melo...@gmail.com> added the comment:

Here is a proof of concept that solves the problem for unicode strings and 
startswith/endswith.
If during the conversion to Unicode a TypeError is raised (e.g. TypeError: 
Can't convert 'list' object to str implicitly), the error message is changed to 
"TypeError: startswith first arg must be str, unicode, or tuple, not list".
If the error is not a TypeError (e.g. a UnicodeDecodeError) the behavior is 
unchanged.
I haven't tested the patch thoroughly, but if this approach is OK I will 
prepare a complete patch.

----------
keywords: +patch
Added file: http://bugs.python.org/file16538/issue6780.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to