Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for postgres unicode bug (Bug#177265) when using with polling.

  • Loading branch information...
commit dd2fbdbb68fa062d7fe78a33747245a79ab591d5 1 parent 07ae511
@anandology anandology authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 web/db.py
View
9 web/db.py
@@ -332,7 +332,14 @@ def db_cursor():
# fix for Bug#177265
if web.ctx.get('db_name') == "postgres":
- web.ctx.db.set_client_encoding('UTF8')
+ try:
+ if web.config._hasPooling:
+ # hack to call a function in actual db connection
+ web.ctx.db._con._con.set_client_encoding('UTF8')
+ else:
+ web.ctx.db.set_client_encoding('UTF8')
+ except Exception, e:
+ print >> web.debug, 'Error in setting utf-8 encoding:', str(e), '(ignored)'
return web.ctx.db.cursor()
web.ctx.db_cursor = db_cursor
Please sign in to comment.
Something went wrong with that request. Please try again.