From: SourceForge.net <no...@so...> - 2006-06-02 13:31:17
|
Bugs item #1016010, was opened at 2004-08-25 16:25 Message generated for change (Settings changed) made by ghaering You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1016010&group_id=16528 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: PgResult Group: None >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Laurent Mignon (mignonlm) Assigned to: Nobody/Anonymous (nobody) Summary: __unicodeConvert not recursive (class cursor) Initial Comment: if a list item is a list of unicode value -> crash def __unicodeConvert(self, obj): if type(obj) is StringType: return obj elif type(obj) is UnicodeType: return obj.encode (*self.conn.client_encoding) elif type(obj) in (ListType, TupleType): converted_obj = [] for item in obj: if type(item) is UnicodeType: converted_obj.append(item.encode (*self.conn.client_encoding)) elif type(item) in (ListType, TupleType): #add recursive routine converted_obj.append (self.__unicodeConvert(item)) else: converted_obj.append(item) return converted_obj elif type(obj) is DictType: converted_obj = {} for k, v in obj.items(): if type(v) is UnicodeType: converted_obj[k] = v.encode (*self.conn.client_encoding) else: converted_obj[k] = v return converted_obj elif isinstance(obj, PgResultSet): obj = copy.copy(obj) for k, v in obj.items(): if type(v) is UnicodeType: obj[k] = v.encode (*self.conn.client_encoding) return obj else: return obj ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2005-02-27 19:41 Message: Logged In: YES user_id=163326 Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1016010&group_id=16528 |