Encoding issues within error messages
When I try to connect using a role that does not exist, pgcli display 'ascii' codec can't decode byte 0xe2 in position 14: ordinal not in range(128) as it obviously trips over a „ character.
That is quite bizarre.
I'm able to reproduce it. I'll see if I can track it down.
Thanks for reporting the bug. :)
This is now fixed in the master. Can you please try it out and let me know? Thanks!
pip install -e git+https://github.com/amjith/pgcli.git#egg=pgcli
Unfortunately after running that command I still get the same error.
cschramm@y ~ % pip list | grep pgcli
pgcli (0.13.0, /home/cschramm/src/pgcli)
cschramm@y ~ % pgcli
'ascii' codec can't decode byte 0xe2 in position 14: ordinal not in range(128)
My bad. I thought I had fixed it, but looks like I fixed a related issue but not this specific one. Thanks for trying it out.
I am also running into a character encoding issue while trying to view a table using a bytea data type.
brian@theon ~ $ pgcli tracker tracker> select * from torrents; 'ascii' codec can't decode byte 0xfa in position 0: ordinal not in range(128)
@bpina This is a different issue, which is actually fixed in master. Can you try the latest from master?
You can install directly from github:
pip install -U -e git+https://github.com/amjith/pgcli.git#egg=pgcli
:+1: that helped, thanks
@cschramm This time I definitely fixed it. :)
Can you give it a shot?
pip install -U -e git+https://github.com/amjith/pgcli.git#egg=pgcli
From my limited testing:

Yeap, now I get my error message. :smiley:
Thanks!
I still get a exception when I connect to a database and run rollback without a transaction in place.
Traceback (most recent call last):
File "/usr/local/bin/pgcli", line 9, in <module>
load_entry_point('pgcli', 'console_scripts', 'pgcli')()
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/Users/yaochunlin/src/pgcli/pgcli/main.py", line 704, in cli
pgcli.run_cli()
File "/Users/yaochunlin/src/pgcli/pgcli/main.py", line 393, in run_cli
click.echo_via_pager('\n'.join(output))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)
@amjith pgcli -U √ab √abc test passed.