QuotedString must be str? (psycopg)

Alban Hertroys alban at magproductions.nl
Tue Sep 28 10:20:04 EDT 2004


I noticed this:

 >>> from psycopg import *
 >>> print QuotedString(u"Unicode string")
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: argument 1 must be str, not unicode


Is it possible somehow to use a unicode string, or would I have to 
escape the strings with my own function (not really a problem, I did 
that before I found out QuotedString exists, but it seems a tad ugly...).

Alban.



More information about the Python-list mailing list