#2335: In some cases MySQLdb returns array.array which causes an error in
a2b_base64()
--------------------------------------------+-------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: reopened | Component: Admin
interface
Version: SVN | Resolution:
Keywords: a2b_base64() | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
--------------------------------------------+-------------------------------
Comment (by Lars Yencken <[EMAIL PROTECTED]>):
I also encountered this bug when I changed my collation from
utf8_general_ci to utf8_bin, which I required for my application. In
response to comment 14, I found no failure when I tried his examples, but
an identical array was returned both times.
In any case, testing with hasattr seemed to work fine and fixed the
problem for me:
{{{
if hasattr(self.session_data, 'tostring):
encoded_data = base64.decodestring(self.session_data.tostring())
else:
encoded_data = base64.decodestring(self.session_data)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/2335#comment:19>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---