Re: getquoted and unicode

Поиск
Список
Период
Сортировка
Искать
От
Daniele Varrazzo
Тема
Re: getquoted and unicode
Дата
Msg-id
AANLkTinhOJXya2+jXm04B6U7=3QhtKy-1MD-xVnx0v27@mail.gmail.com
Ответ на
Re: getquoted and unicode (Carl S. Yestrau Jr.)
Список
Дерево обсуждения
getquoted and unicode "Carl S. Yestrau Jr." <carl@featureblend.com>
Re: getquoted and unicode Karsten Hilbert <Karsten.Hilbert@gmx.net>
Re: getquoted and unicode Karsten Hilbert <Karsten.Hilbert@gmx.net>
Re: getquoted and unicode Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: getquoted and unicode "Carl S. Yestrau Jr." <carl@featureblend.com>
Re: getquoted and unicode Daniele Varrazzo <daniele.varrazzo@gmail.com>
On Sun, Jan 23, 2011 at 5:17 PM, Carl S. Yestrau Jr.
 wrote:
> It does work, using this branch, thank you.

This will likely be included in the next release.

> One observation, the string returned is of type str, not unicode.
>
> Example:
> import psycopg2
> psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
> adapted = psycopg2.extensions.adapt(u'test')
> print adapted.getquoted()
> #

Yes, this is what expected. Adaptation is taking a Python object and
converting it into a SQL representation: this is always a bytes
string, as it has to be sent to the socket.

-- Daniele
В списке psycopg по дате отправления
От: Daniele Varrazzo
Дата:
От: Nicolas Grilly
Дата:
FAQ