#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
--------------------------------------------+-------------------------------
Changes (by [EMAIL PROTECTED]):
* needs_better_patch: 0 => 1
Comment:
Fixing asap takes very long time.
This bug occur when you have MySQL database in utf-8, and your collation
is utf8_bin.
I get rid from this bug usually with keeping my utf-8 databases in
collation utf8_general_ci.
Patch from [EMAIL PROTECTED] can not fix this bug, but you can add
small check for type at the same place.
Say, you can replace
{{{
encoded_data = base64.decodestring(self.session_data)
}}}
with
{{{
if type(self.session_data) == list:
encoded_data = base64.decodestring("".join(self.session_data))
else:
encoded_data = base64.decodestring(self.session_data)
}}}
I am not insist this code runs without errors, but idea is clear. This is
ugly workaround, but failing admin area is more ugly probably, rspecially
for newcomers running tutorial. This kind of check is used now when
uploading files, so having such a fragment is not a big deal. If this
error is caused by MySQLdb of some versions, some people anyway will have
that version, so better have it fixed here than wait when MySQLdb will be
fixed and all people will update their MySQLdb.
--
Ticket URL: <http://code.djangoproject.com/ticket/2335#comment:17>
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
-~----------~----~----~----~------~----~------~--~---