Closed tkamenoko closed 5 years ago
I can't reproduce that on my Mac. 🤷♂️
What happens if you try setting an encoding with a line like this at the top of your file? (If you are not using utf8, then replace that with your actual encoding):
# -*- coding: utf8 -*-
Also, what is your codepage set to?
@CleanCut Setting encoding comment has no effect.
@MinchinWeb default 932(shift-jis), but same result on 65001(utf-8).
In my opinion, this is caused by unidecode
package.
To reproduce, run this code.
from unidecode import unidecode
print("日本語") # -> 'Ri Ben Yu'
I think you figured out what's going on, and I can fill in the why: unidecode
was brought in as Unicode output was causing a number of hard to debug and reproduce issues on Windows. With unidecode
, green
would at least output something, rather than crash.
So green
is working as it was designed to. But do we need a command line or environmental variable to turn this off?
I agree. This is expected, but not necessarily ideal.
If we added an option to disable this behavior, would anyone use it? @tkamenoko @MinchinWeb
Yes, I think so. Current behavior is not documented and may lead to confusion. The same output as builtin unittest
is required.
Fix is in 2.14.0, just released.
Platform: Windows 10 64bit Python: 3.7 Shell: Powershell 6.1.1
Test code:
Output by
Green
:Output by builtin
unittest
:Test finished as expected, but that is wrong output(
日本語
->Ri Ben Yu
).