UnicodeEncodeError
We have multibyte chars in our test cases like _平 ^~ŸÁ&. In log files we have been seeing error-
Calling method 'end_keyword' of listener 'RobotStackTracer' failed: UnicodeEncodeError: 'charmap' codec can't encode character '\u5e73' in position 659: character maps to <undefined>
I don't see any major effect of this though, but since it is logged in our every run thought of reporting.
Can you give me a reproducible example?
Please also specify the environment: Windows Version: Python Version: Which Terminal are you using?
https://robotframework.slack.com/archives/C07PJBN64/p1677798947815299
Same error appears with an other user. Still no possibility to reproduce for me
This happens on windows server. We execute our runs from TeamCity so the terminal should be windows command prompt. I will check if I can create a dummy test to reproduce this and will post soon.
We can reproduce!
in the slack thread there is the fix. I just had no time yet to fix it
Could you copy the solution here from slack since i have no access to that slack thread? Thanks in advance!
this is from slack
If you change line 127 in init.py of RobotStackTracer to
print(console_encode("\n".join(self._create_stacktrace_text())))and change line 20 tofrom robot.utils import cut_long_message, console_encodeThen you have a fixYou will not see the ✖️ character but you will get a ?