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

charmap problem #316

Open
anoordover opened this issue Oct 12, 2023 · 1 comment
Open

charmap problem #316

anoordover opened this issue Oct 12, 2023 · 1 comment

Comments

@anoordover
Copy link

We get following error when runnig the sigrid ci on azure devops:
Traceback (most recent call last):
File "./sigridrepo/sigridci/sigridci.py", line 106, in
runner.run()
File "D:\Agents\Agent_Azuredevops_35284_1_work\6730\s\sigridrepo\sigridci\sigridci\sigridci_runner.py", line 73, in run
self.displayFeedback(analysisId)
File "D:\Agents\Agent_Azuredevops_35284_1_work\6730\s\sigridrepo\sigridci\sigridci\sigridci_runner.py", line 86, in displayFeedback
report.generate(analysisId, feedback, self.options)
File "D:\Agents\Agent_Azuredevops_35284_1_work\6730\s\sigridrepo\sigridci\sigridci\pipeline_summary_report.py", line 34, in generate
self.printConclusionMessage(feedback, options, status)
File "D:\Agents\Agent_Azuredevops_35284_1_work\6730\s\sigridrepo\sigridci\sigridci\pipeline_summary_report.py", line 47, in printConclusionMessage
asciiArt.printColor(f"** {message} **", asciiArt.ANSI_BOLD + color)
File "D:\Agents\Agent_Azuredevops_35284_1_work\6730\s\sigridrepo\sigridci\sigridci\ascii_art_report.py", line 88, in printColor
print(ansiPrefix + message + "\033[0m", file=self.output)
File "D:\Agents\Agent_Azuredevops_35284_1_work_tool\Python\3.8.1\x64\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f7f0' in position 12: character maps to

Adding the line "set PYTHONIOENCODING=utf-8" to the script tasks seems to resolve this issue.

@dennis-sig
Copy link
Contributor

@anoordover From the file paths I assume you're using a Windows-based runner in Azure DevOps, right?

We are indeed assuming UTF-8 encoding because we want to use emoji in the output. We made the assumption UTF-8 is the default encoding pretty much everywhere, but this shows we were wrong. We'll update the documentation accordingly to address this, thank you for reporting it. cc @MichielCuijpers

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

2 participants