From: SourceForge.net <no...@so...> - 2005-02-21 03:04:21
|
Bugs item #967372, was opened at 2004-06-05 21:00 Message generated for change (Settings changed) made by ballie01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=967372&group_id=16528 Category: PgNumeric Group: None >Status: Pending >Resolution: Fixed Priority: 5 Submitted By: Ben Burton (bab) Assigned to: Nobody/Anonymous (nobody) Summary: PgNumeric.__cmp__ does not handle non-numbers Initial Comment: Hi. I received the following report through the debian BTS (#251401). The fix is very simple (I've already applied it to the debian packages) -- simply change "return None" to "return 1" in the __cmp__ implementation. The original bug report is below, and the one-line patch is attached. Ben. ORIGINAL BUG REPORT: I just had a website break due to what eventually turned out to be a bug in the __cmp__ method for PgNumeric. The problem is a small bug in its return values: when it can not coerce the object it is compared to to a PgNumeric it returns None, which is not allowed for a __cmp__ function. Simply fixing the return value fixes this, see the patch below. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=967372&group_id=16528 |