|
Coding when open conection: msg#00015python.db.psycopg.devel
Hi all, I'm new in this list. My name is Oswaldo and my english is bad (sorry). I have a problem when I try to connect with a bad user or a bad database name: Server: Postgres 8.1 windowsXP Database encoding: UTF8 postgres.conf client_encoding UTF8 lc_messages es_ES Client: Python 2.4.2 + psycopg2 2.0b8 defaultecoding UTF8 Windows XP The Conection: import psycopg2 as pg import psycopg2.extras as pgxtra .... pgcon = pg.connect(" ..... ") pgcon.set_client_encoding('UTF8') When I connect with a valid user and database there is no problem with spanish chars and simbols. But if I put a bad user in the connection string I have the following message: File "C:\Python24\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xab in position 96: unexpected code byte These exception is caused by the Postgres spanish error message: FATAL: no existe el rol «user» where 'user' is eclosed between '«' and '»' chars. I try to connect with a bad user with PgAdminIII and EMS and both show the message correctly. Hereby I suppose that the problem is that psycopg2 don't use utt8 until set_client_encoding is sended, and the message is received before it. Thanks. -- ***************************************** Oswaldo Hernández oswaldo-aXkDUzFGsCcxAGwisGp4zA@xxxxxxxxxxxxxxxx ***************************************** |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [psycopg] #100: null pointer: 00015, psycopg |
|---|---|
| Next by Date: | Re: Coding when open conection: 00015, Markus Bertheau |
| Previous by Thread: | [psycopg] #100: null pointeri: 00015, psycopg |
| Next by Thread: | Re: Coding when open conection: 00015, Markus Bertheau |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |