This project is archived and is in readonly mode.
sefault on mogrify with a Decimal
-
Daniele Varrazzo
- State changed from new to resolved
- Milestone set to release-2.3.0
- Milestone order changed from 4 to 0
Thank you for the report. I had already refactored mogrify to use more code in common with execute (mostly to support unicode queries) and as a result this bug was fixed. I will add a regression test though.
In [9]: cursor.mogrify('select %s', (Decimal('3.27'),))
Out[9]: 'select 3.27'Code available in the python2 branch of my git repository http://tinyurl.com/piro-psycopg2 <git://src.develer.com/users/piro/psycopg2.git>, soon to be released.
-
Daniele Varrazzo
Nate,
I've found the cause of the crash: the Decimal adapter incorrectly assumed the existence of the
is_finite()method: it was actually introduced somewhere after 2.5.1 and is available e.g. in 2.5.4.I've fixed the issue in my repos, but the bug is still present in the 2.3.0-beta1. Jason is preparing a Window package.
-
Daniele Varrazzo
The bug is fixed in the current repository. It only affects Python 2.5.0 and 2.5.1.
If you want to test on windows, you can use this unofficial build for windows and Python 2.5.
-
Nate C
Thanks, that worked for me. (I wish they would upgrade python on these machines I have to work on! ;)