Skip to content

[BUG] UnicodeEncodeError on line 155 (cli.py) when running on Windows #54

Description

@matejbasic

Hi, colleague of my mine was unable to run pycln as a pre-commit hook on his Windows machine.
I have tried it myself and it fails with the same error message:

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

Problematic line:

typer.echo(str(reporter), nl=False)

I have tried to fix it and encoding it to UTF-8 seems to help:

typer.echo(str(reporter).encode("utf-8"), nl=False)

I will prepare PR for this.

Environment:

  • Python Version: Python 3.9
  • Pycln Version: v0.0.2
  • OS Type: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions