Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

GitHub Workflow "Windows 2019" fails because of Unicode output #1

Open
Release-Candidate opened this issue Mar 23, 2021 · 1 comment

Comments

@Release-Candidate
Copy link
Owner

Describe the bug
The GitHub Workflow "Windows 2019" fails because of Unicode output

To Reproduce
Steps to reproduce the behavior:

  1. Run GitHub Workflow "Windows 2019"
  2. 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
Copy link
Owner Author

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.

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

No branches or pull requests

1 participant