sigridci icon indicating copy to clipboard operation
sigridci copied to clipboard

charmap problem

Open anoordover opened this issue 2 years ago • 1 comments

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.

anoordover avatar Oct 12 '23 07:10 anoordover

@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

dennis-sig avatar Oct 12 '23 09:10 dennis-sig