petehunt/PyMySQL — pull request #93 by clelland (2011-12-15 06:33:37+00:00)
Title: Fix for Python 2.x mixing unicode and ascii strings

The code could fail if a unicode object is used as the query, and a
utf-8 encoded string with characters outside of the ASCII range is
passed in as one of the query arguments. This fix encodes the query in
the appropriate character set *before* applying the escaped args, as the
MySQLdb adapter does.

This was discovered through the Django unit tests -- specifically, this fixes a failure in httpwrappers.HttpResponseTests.test_iter_content (tests/regressiontests/httpwrappers/tests.py(297))