Patch for 'mysql_old' users... (unicode error)

2 views
Skip to first unread message

Jens Diemer

unread,
Sep 26, 2007, 9:01:15 AM9/26/07
to django...@googlegroups.com

On my SharedWebspace i have only a old MySQLdb version (v1.2.1g2) :(
So i must use mysql_old and i trapped into unicode errors.

The Problem is: The database results are not unicode.
There exists a ticket: http://code.djangoproject.com/ticket/4741

In this combination there is probably a problem with the Traceback. If a Unicode
error appears, the values in the traceback seems to be unicode. But this is not
true. The data from the database are byte strings.

I have made a Patch for the file ./django/db/backends/mysql_old/base.py to fix
the unicode problem. You can find the Patch in the ticket.

The solution is: All byte string results from the database must be decoded to
unicode.

If you have the same Problem, you can use the patch from the ticket. If you have
trouble to apply the patch, mail me. I can send you the patched base.py.

Please let me know if this works for you or not.


--
Mfg.

Jens Diemer


----
A django powered CMS: http://www.pylucid.org

Reply all
Reply to author
Forward
0 new messages