Skip to content

bug: install_tools.py Unicode checkmark fails on Windows cp1252 #328

@endavis

Description

@endavis

Bug Description

The install_tool() function in tools/doit/install_tools.py uses \u2713 (checkmark) in print statements. On Windows CI, doit's output stream uses cp1252 encoding which cannot encode this character, causing a UnicodeEncodeError.

Steps to Reproduce

  1. Run doit install_tools or doit install_direnv on Windows CI (e.g. GitHub Actions windows-latest)
  2. The tool installs successfully but crashes when printing the success message

Expected vs Actual Behavior

Expected: Success message prints on all platforms
Actual:

UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 0: character maps to <undefined>

Stack trace from CI:

File "tools/doit/install_tools.py", line 263, in _install_age
    print("\u2713 age installed.")
File ".venv/Lib/site-packages/doit/action.py", line 359, in write
    stream.write(text)
File "C:\...\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError

Proposed Fix

Replace Unicode checkmarks with ASCII equivalents. See endavis/pynetappfoundry#459 for the fix applied downstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds review and prioritization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions