From: SourceForge.net <no...@so...> - 2005-01-16 08:57:20
|
Bugs item #1103260, was opened at 2005-01-16 19:57 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=1103260&group_id=16528 Category: PgInt2 Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew I MacIntyre (aimacintyre) Assigned to: Nobody/Anonymous (nobody) Summary: comparison with float fails on Python 2.4 Initial Comment: Running the regression test of pyPgSQL 2.4 on a build for Python 2.4 has 2 failures: ...............FF................................................. ====================================================================== FAIL: CheckPgInt2 (__main__.PgSQLTestModuleInterface) ---------------------------------------------------------------------- Traceback (most recent call last): File "PgSQLTestCases.py", line 216, in CheckPgInt2 self.failUnless(a == 181.0, 'PgInt2 comparison to Float failed.') AssertionError: PgInt2 comparison to Float failed. ====================================================================== FAIL: CheckPgInt8 (__main__.PgSQLTestModuleInterface) ---------------------------------------------------------------------- Traceback (most recent call last): File "PgSQLTestCases.py", line 184, in CheckPgInt8 'PgInt8 comparison to Float failed.') AssertionError: PgInt8 comparison to Float failed. ---------------------------------------------------------------------- Ran 66 tests in 36.950s FAILED (failures=2) The regression test has no failures when built with Python 2.3.4. This is on OS/2 EMX - I can't test this on another platform at the moment :-( I have done some debugging, and the issue appears to arise from the int2_coerce()/int8_coerce() functions. I have been able to modify these functions to get these tests to pass, but then the ability to add other number types with PgInt2/PgInt8 objects fails.... For what its worth, I've attached the patch I came up with for reference purposes (I don't believe its suitable for application to the source tree). This patch is based on behaviour I inferred from the way that the Python native numeric types have their coercion routines written. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1103260&group_id=16528 |