GitHub Workflow "Windows 2019" fails because of Unicode output
Opened this issue · 1 comments
Release-Candidate commented
Describe the bug
The GitHub Workflow "Windows 2019" fails because of Unicode output
To Reproduce
Steps to reproduce the behavior:
- Run GitHub Workflow "Windows 2019"
- See error
UnicodeEncodeError: 'charmap' codec can't encode character '\u02bc' in position 12: character maps to <undefined>
Expected behavior
Output of Run tzolkin-calendar
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
pipenv run python -m tzolkin_calendar -y
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
pythonLocation: C:\hostedtoolcache\windows\Python\3.9.2\x64
JAVA_HOME_13.0.6_x64: C:\hostedtoolcache\windows\jdk\13.0.6\x64
JAVA_HOME: C:\hostedtoolcache\windows\jdk\13.0.6\x64
JAVA_HOME_13_0_6_X64: C:\hostedtoolcache\windows\jdk\13.0.6\x64
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.9.2\x64\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\hostedtoolcache\windows\Python\3.9.2\x64\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\a\tzolkin-calendar\tzolkin-calendar\tzolkin_calendar\__main__.py", line 31, in <module>
main.main()
File "D:\a\tzolkin-calendar\tzolkin-calendar\tzolkin_calendar\main.py", line 49, in main
__displayYear(cmdline_args)
File "D:\a\tzolkin-calendar\tzolkin-calendar\tzolkin_calendar\main.py", line 360, in __displayYear
__displayYearList(year_dict)
File "D:\a\tzolkin-calendar\tzolkin-calendar\tzolkin_calendar\main.py", line 374, in __displayYearList
print(key_string)
File "C:\hostedtoolcache\windows\Python\3.9.2\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 '\u02bc' in position 12: character maps to <undefined>
Error: Process completed with exit code 1.
Desktop (please complete the following information):
- OS: Windows
- Version: 2019 Server
- Python version 3.9.2
Additional context
Works on my Desktop Windows 10 Pro
Release-Candidate commented
Change https://github.com/Release-Candidate/tzolkin-calendar/blob/main/.github/workflows/windows.yml
Adding $OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
didn't help.