Bugs item #1916844, was opened at 2008-03-17 10:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1916844&group_id=56967

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: None
Group: Clients CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andrey Tovchigrechko (andreyto)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bug in Python interface converters.py

Initial Comment:
MonetSQLdb.converters.escape(x, conv=None)
should return 'tuple' for any input sequence type (currently it returns tuple 
only if it receives tuple, and returns list if it receives list).
The return result is used as a second argument in expression 'query = query % 
self.connection.literal(args)' in cursors.py. The '%' operator raises an 
exception on anything but tuple.
Also, when 'escape()' cannot convert some argument, it should immediately raise 
a descriptive exception. Currently it silently drops the argument from the 
result sequence, which causes an exception to be raised later in the calling 
code. That exception reads like this:
"""ProgrammingError: not enough arguments for format string"""
This unnecessarily  complicates debugging.

System:
2.6.16.27-0.6-smp #1 SMP Wed Dec 13 09:34:50 UTC 2006 x86_64 x86_64 x86_64 
GNU/Linux
gcc 4.10
python 2.4.4

I attached test and patch files. Alternatively, Connection.literal() can 
convert 'escape()' result to a tuple.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1916844&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to