-
Notifications
You must be signed in to change notification settings - Fork 149
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: 'charmap' codec can't encode characters in position 0-79: character maps to <undefined> #119
Comments
That's odd. I tried to reproduce this locally on different windows environments but wasn't able to. It looks like the output is the problem here: https://github.com/pyupio/safety/blob/master/safety/formatter.py#L48 |
@nnadeau, is this fixed for you now? |
I'll check asap when I get access to a Windows PC |
My Jenkins Windows builds fail with this error only against Python 3.5-3.7. This is not an issue with Python 2.7 or Python 3.4. I am unable to reproduce this issue on the same machine using the same Python executables as a regular user. |
I had the same issue when I used git bash insted of CMD. With CMD it works fine. |
I'm seeing this error using Miniconda on AppVeyor. See the build log. You can inspect the repo and configuration here. |
I'm hitting the same issue on Python 3.7.4 when running MinGW (GitBash) and also in cygwin bash but in that instance only when running it in a sub-shell as |
In my case, export PYTHONIOENCODING=UTF-8 solved my issue. |
Still not fixed, but the workaround from @shahha works for me as well |
I know this has been around for quiet a while now, but I would need another feedback from anyone who is still experiencing this with latest version. If you do, please write me down your Safety version, your operating system and your complete stack trace. |
Still experience this error Using safety 1.8.7 I get the following:
|
@janusheide thank you very much for such details. That confirmed my hypothesis. This stack trace confirms the error was dumping a report to standard output:
Our JSON Formater is using a special character to draw the framing that is not being mapped properly. This console session shows the issue:
So, we need some code that will either decode properly or just change that ASCII art to not use non-ASCII characters. My preference is towards the second option, which should cause less issues. |
Thanks for you quick response and shedding some light on the problem! To me just using a conforming character is the simpler, faster and more future prof approach, so that would get my vote :) If there is something I can do to help, please let me know. |
Windows-10-10.0.16299-SP0
,AMD64
Description
safety check
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-79: character maps to <undefined>
What I Did
Contents of
simple-requirements.txt
Traceback
Similar Issues
The text was updated successfully, but these errors were encountered: