8000 Possible error on stdout with non-ascii chars · Issue #26 · pgxn/pgxnclient · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Possible error on stdout with non-ascii chars #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dvarrazzo opened this issue Feb 16, 2016 · 1 comment
Closed

Possible error on stdout with non-ascii chars #26

dvarrazzo opened this issue Feb 16, 2016 · 1 comment

Comments

@dvarrazzo
Copy link
Member
piro@risotto:~$ pgxn search oracle
first_last_agg 0.1.4
    ... which do you get and for emulating a similar functionality from
    *Oracle*. Author Jan Urbański, based on code from the PostgreSQL wiki,
    specifically on the SQL definitions of first and last taken from...

imcs 0.1.6
    .. There are also extensions to existed DBMSes, such as "*Oracle* In-
    Memory Option". This plug-in tries to provide such functionality for
    PostgreSQL.

pgTAP 0.95.0
    Examples: SELECT fdw_privs_are( '*oracle*', 'fred', ARRAY['USAGE'],
    'Fred should be granted USAGE on fdw "*oracle*"' ); SELECT
    fdw_privs_are( 'log_csv', ARRAY['USAGE'] ); If the role is granted...
piro@risotto:~$ pgxn search oracle | cat
first_last_agg 0.1.4
    ... which do you get and for emulating a similar functionality from
ERROR: unexpected error: UnicodeEncodeError - 'ascii' codec can't encode character u'\u0144' in position 29: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pgxnclient/cli.py", line 59, in script
    main(args)
  File "/usr/local/lib/python2.7/dist-packages/pgxnclient/cli.py", line 31, in main
    run_command(opt, parser)
  File "/usr/local/lib/python2.7/dist-packages/pgxnclient/commands/__init__.py", line 96, in run_command
    return opts.cmd(opts, parser=parser).run()
  File "/usr/local/lib/python2.7/dist-packages/pgxnclient/commands/info.py", line 95, in run
    print "    " + line
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0144' in position 29: ordinal not in range(128)

Difference seems stdout encoding:

piro@risotto:~$ python -c "import sys; print sys.stdout.encoding" 
UTF-8
piro@risotto:~$ python -c "import sys; print sys.stdout.encoding" | cat
None
@dvarrazzo
Copy link
Member Author

Better fixing this after porting to py3 without 2to3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0