pgdb doesn't work with #23

cninucci opened this Issue Aug 16, 2010 · 1 comment


None yet

2 participants


I only have pgdb installed on my system and I can't use Postgrès with web.db.
I get the following exceptions:

File "/usr/lib64/python2.6/site-packages/web/", line 918, in _connect
AttributeError: 'pgdbCnx' object has no attribute 'set_client_encoding'

Indeed, pgdb module doesn't provide this method or any equivalent.

Here's a patch for the file that works at home, I think it will preserve the behavior for psycopg* users. I did'nt figure out how to know which module in the was used in the _connect contexte, so I exploited the AttributeError exception to call the correct method.

<         conn.set_client_encoding('UTF8')

>         try:
>             conn.set_client_encoding('UTF8')
>         except (AttributeError):
>             conn.cursor().execute("set client_encoding to 'UTF-8'")

There's the same issue with _connect_with_pooling, but I didn't meet her ;)
Have a nice day :)


Fixed error in creating PostgresDB with pgdb driver. Closed by 35674c8 (tx cninucci)

@s7v7nislands s7v7nislands pushed a commit to s7v7nislands/webpy that referenced this issue May 4, 2011
@anandology anandology Fixed error in creating PostgresDB with pgdb driver. Closes #23 (tx c…
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment