#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: 0
--------------------------------------------+-------------------------------
Changes (by Simon G. <[EMAIL PROTECTED]>):
* cc: [EMAIL PROTECTED] (added)
Comment:
Ok - if I'm understanding MySQLdb properly, we need to get rid of that
char_array converter for "252" (i.e. BLOB fields). I'm not sure what the
best converter is, but Thing2Str looks like it will work.
So, try this and see if it helps:
{{{
>>> from django.conf import settings as s
>>> from django.contrib.sessions.models import Session
>>> import MySQLdb
>>> db = MySQLdb.connect(host=s.DATABASE_HOST, user=s.DATABASE_USER,
passwd=s.DATABASE_PASSWORD, db=s.DATABASE_NAME)
>>>
>>> # THIS SHOULD FAIL WITH THE a2b_base64 ERROR
>>> Session.objects.all()[0].session_data
>> # UPDATE THE CONVERTERS AND TRY AGAIN
>>> db.converter.update({ 252: MySQLdb.converters.Thing2Str, })
>>> Session.objects.all()[0].session_data
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/2335#comment:14>
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
-~----------~----~----~----~------~----~------~--~---