pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Encoding issues within error messages

Open cschramm opened this issue 11 years ago • 11 comments

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.

cschramm avatar Jan 16 '15 08:01 cschramm

That is quite bizarre.

I'm able to reproduce it. I'll see if I can track it down.

Thanks for reporting the bug. :)

amjith avatar Jan 16 '15 08:01 amjith

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

amjith avatar Jan 26 '15 15:01 amjith

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)

cschramm avatar Jan 26 '15 15:01 cschramm

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.

amjith avatar Jan 26 '15 15:01 amjith

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 avatar Jan 26 '15 18:01 bpina

@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

amjith avatar Jan 26 '15 18:01 amjith

:+1: that helped, thanks

bpina avatar Jan 26 '15 19:01 bpina

@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:

screen shot 2015-01-26 at 11 08 16 pm

amjith avatar Jan 27 '15 07:01 amjith

Yeap, now I get my error message. :smiley:

cschramm avatar Jan 27 '15 08:01 cschramm

Thanks!

djoker avatar Aug 18 '15 16:08 djoker

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.

chunlinyao avatar May 04 '16 08:05 chunlinyao