cleo icon indicating copy to clipboard operation
cleo copied to clipboard

Bug in 0.7.5 with colorful parsing in self.line()

Open bmoeskau opened this issue 6 years ago • 0 comments

Hello, thanks so much for all the great work!

It seems that either cleo 0.7.5 or clikit 0.3.0 or 0.3.1 broke something with the following use case. Ever since we started using cleo, we have used colorful inside our command classes with the following syntax:

   self.line(colorful.red | "Some error")

Normally this outputs a red message as expected. In the latest upgrade, this raises the following error:

[TypeError]
expected string or bytes-like object

If I coerce the arg to string manually, it works:

  self.line(str(colorful.red | "Some error"))

However, that should not be needed, and never has before. Also, the standard print() call continues to work as expected:

    print(colorful.red | "Some error")

My fix for now is to pin our dependencies at cleo 0.7.4 (which installs clikit 0.2.4). Hopefully we can get this fixed and resume upgrading like normal :)

Again, I really appreciate everything, and would be happy to help out if you need anything else.

bmoeskau avatar Jun 30 '19 19:06 bmoeskau