Hello!

On Tue, Oct 02, 2007 at 09:34:08AM +0200, Markus Gritsch wrote:
> the new version 0.9.2b1 added a try except block around the conversion
> to unicode of the query in mysqlconnection.py:
> 
>     if self.need_unicode and not isinstance(query, unicode):
>         try:
>             query = unicode(query, self.encoding)
>         except UnicodeError:
>             pass
> 
> In which case is it necessary that the UnicodeError is silently
> ignored?  Isn't it dangerous and misleading to swallow such an
> exception?

   Pretty valid concern that deserves a longer answer.

   From time to time people report problems with MySQLdb and unicode. See
this report, for example:

http://sourceforge.net/mailarchive/forum.php?thread_name=54b165660707111303h45521239ncc4df928fb40a975%40mail.gmail.com&forum_name=sqlobject-discuss

   I never knew how to fix the problem, and was reluctant to apply
different patches that were more like small hacks to fix small part of
the problem.
   Finally David Turner dived into the problem and, using test_blob.py and
test_unicode.py tests, fixed the problem; the try/except is the part of the
solution.
   As I don't use MySQL I have to rely on the work of other people, and
this time it seems David done a good job, so I blessed the inclusion of the
code.
   Do you have a problem with the new code? Can you write a valid test case
that breaks on the code?

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to