Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

"TypeError: coercing to unicode" when piping colored output #27

Closed
ghost opened this issue Apr 22, 2012 · 1 comment
Closed

"TypeError: coercing to unicode" when piping colored output #27

ghost opened this issue Apr 22, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 22, 2012

When I use octogit in a pipeline

$ octogit issues | less

I get the following traceback:

Traceback (most recent call last):
  File "/home/dialelo/.virtualenvs/o/bin/octogit", line 8, in <module>
    load_entry_point('octogit==0.1.3', 'console_scripts', 'octogit')()
link. https://github.com/alejandrogomez/turses/issues 

  File "build/bdist.linux-i686/egg/octogit/cli.py", line 126, in begin
  File "build/bdist.linux-i686/egg/octogit/core.py", line 252, in get_issues
TypeError: coercing to Unicode: need string or buffer, int found

The line that causes the error:

puts('listing all {0} issues.'.format(colored.red(get_number_issues(json_data)))) 

If I remove the colored.red function call it does not happen.

@myusuf3
Copy link
Owner

myusuf3 commented Apr 24, 2012

I fixed this issue; but this breaks the structured layout of the issues list. It not doesn't throw an error, but less isn't very usable with octogit in this manner.

@myusuf3 myusuf3 closed this as completed Apr 24, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant