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

ti log crashes with pipe #18

Open
francoisbeaulieu opened this issue Oct 2, 2015 · 2 comments
Open

ti log crashes with pipe #18

francoisbeaulieu opened this issue Oct 2, 2015 · 2 comments

Comments

@francoisbeaulieu
Copy link

Hi,

Any idea why 'ti log' would crash anytime you try to pipe the output to another command? I'm running Python2.7 on Mac OSX Yosemite.

Output:

% ti log | grep PCO
Traceback (most recent call last):
File "/usr/local/bin/ti", line 434, in
main()
File "/usr/local/bin/ti", line 426, in main
fn(**args)
File "/usr/local/bin/ti", line 235, in action_log
end=' ← working\n' if current == name else '\n')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

@MattHulse
Copy link
Contributor

Submitted pull request #19. For some reason when the output is piped, the unicode character '←' isn't being encoded properly. You could just convert that character to ascii (<--) or add the explicit encode after the string: '← working\n'.encode('utf-8')

@francoisbeaulieu
Copy link
Author

The committed patch does appear to fix my issue. Thanks!

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

2 participants