Shouldn't assume that stdout supports Unicode...
Hmm, that's strange – it should definitely handle that and decode the strings accordingly.
Edit: What does locale.getpreferredencoding() return for you?
Let me see, this happens inside a container within our CI environment.
The container is a different env, could be the problem.
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
locale.getpreferredencoding()
'UTF-8'
Ahhh, that might explain what's going on. Internally, wasabi calls string.encode(encoding, "ignore").decode("utf8"). So maybe for cases like this, we also have to check for sys.stdout.encoding? I'll look into this.
I'll also add an environment variable for disabling pretty printing (which will remove color, icons etc.). There's already WASABI_LOG_FRIENDLY, but that only removes animations and ANSI escape sequences for colors etc.
The link command is executed in a BASH script by a CI system, so stdout is not a Python/Ipython interpreter. Is there a workaround if I want to try to use 2.1?
The link command is executed in a BASH script by a CI system, so stdout is not a Python/Ipython interpreter.
🤔 Not quite sure I follow there? I mean, it's very normal that the script is running from bash...
I think it's just a question of checking the right thing to see whether unicode is supported. In the meantime, is using Python3 an option?
Try setting PYTHONIOENCODING=UTF-8?
I also just pushed a new version of wasabi (0.1.4) that supports a WASABI_NO_PRETTY environment variable. So you can do export WASABI_NO_PRETTY=1 or something, and it should strip out icons and other formatting.
Just published wasabi v0.2.0, which should fix this by default. I was able to reproduce the problem in the CI and also added some nicer fallbacks.
cc: @bdewilde Could you try upgrading wasabi and check if it works without the env var now?
The new version works great — thank you, @ines!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
The new version works great — thank you, @ines!