Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError #6

Open
amitlohar opened this issue Feb 8, 2023 · 6 comments
Open

UnicodeEncodeError #6

amitlohar opened this issue Feb 8, 2023 · 6 comments

Comments

@amitlohar
Copy link

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.

@Snooz82
Copy link
Member

Snooz82 commented Mar 4, 2023

Can you give me a reproducible example?

Please also specify the environment:
Windows Version:
Python Version:
Which Terminal are you using?

@Snooz82
Copy link
Member

Snooz82 commented Mar 4, 2023

https://robotframework.slack.com/archives/C07PJBN64/p1677798947815299

Same error appears with an other user.
Still no possibility to reproduce for me

@amitlohar
Copy link
Author

amitlohar commented Mar 8, 2023

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.

@Snooz82
Copy link
Member

Snooz82 commented Mar 8, 2023

We can reproduce!

in the slack thread there is the fix.
I just had no time yet to fix it

@ish91
Copy link

ish91 commented Oct 18, 2024

Could you copy the solution here from slack since i have no access to that slack thread? Thanks in advance!

@Snooz82
Copy link
Member

Snooz82 commented Oct 18, 2024

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 to
from robot.utils import cut_long_message, console_encode
Then you have a fix

You will not see the ✖️ character but you will get a ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants