Skip to content
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

UnicodeEncodeError in remote file output #65

Open
nchern opened this issue Mar 27, 2015 · 0 comments
Open

UnicodeEncodeError in remote file output #65

nchern opened this issue Mar 27, 2015 · 0 comments

Comments

@nchern
Copy link

nchern commented Mar 27, 2015

If remote file contains some unicode characters, utility like mesos-tail fails with:

Traceback (most recent call last):
  File "/usr/local/bin/mesos-tail", line 9, in <module>
    load_entry_point('mesos.cli==0.1.4', 'console_scripts', 'mesos-tail')()
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/cli.py", line 80, in wrapper
    return fn(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/log.py", line 44, in timer
    return fn(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/cli.py", line 54, in wrapper
    return fn(cmd_args, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/cmds/tail.py", line 87, in main
    output(last_lines)
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/cmds/tail.py", line 85, in output
    lines, not args.q, key=fname)
  File "/Library/Python/2.7/site-packages/mesos.cli-0.1.4-py2.7.egg/mesos/cli/cli.py", line 130, in output_file
    print(line)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 133-136: ordinal not in range(128)

Possible fix is to change this line: https://github.com/mesosphere/mesos-cli/blob/master/mesos/cli/cli.py#L130
to

print(line.encode('utf-8'))
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