From: SourceForge.net <no...@so...> - 2004-10-27 10:02:02
|
Bugs item #1055180, was opened at 2004-10-27 23:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1055180&group_id=16528 Category: PgSQL Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mike McGavin (jesterzog) Assigned to: Nobody/Anonymous (nobody) Summary: __unicodeConvert doesn't recognise subclasses of UnicodeType Initial Comment: Cursor.__unicodeConvert() (in PgSQL.py) doesn't encode unicode strings all the time. If the object that is passed is of a type that is a subclass of a UnicodeType, rather than of the UnicodeType itself, the __unicodeConvert() method doesn't recognise it as unicode, even though it is. This appears to be because most of the comparisons within the __unicodeConvert() method use the "is" operator to check the object type, which only compares exact types and doesn't take sub-classing into account. This bug may be able to be fixed quite easily, by changing the comparisons (about 7 of them) to use 'isinstance()' instead of the 'is' operator. ie. Instead of: if type(obj) is UnicodeType: doSomething() the code should read: if isinstance(obj, UnicodeType): doSomething() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1055180&group_id=16528 |