QuotedString must be str? (psycopg)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alban Hertroys

    #1

    QuotedString must be str? (psycopg)

    I noticed this:
    [color=blue][color=green][color=darkred]
    >>> from psycopg import *
    >>> print QuotedString(u" Unicode string")[/color][/color][/color]
    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.
Working...