fair-software / howfairis

Command line tool to analyze a GitHub or GitLab repository's compliance with the fair-software.eu recommendations
https://pypi.org/project/howfairis/
Apache License 2.0
54 stars 22 forks source link

Encoding Error under Windows 10 (using Git shell) #329

Open caha42 opened 3 years ago

caha42 commented 3 years ago

I tried to run the check in a git shell under Win10 I get the following error:

howfairis.exe https://github.com/fdiblen/grlc Checking compliance with fair-software.eu... url: https://github.com/fdiblen/grlc (1/5) repository UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 0: character maps to

If it runs unsuccessful, I do not get an error, but the output is broken:

howfairis.exe https://gitlab.com/hifis/hifis-workshops/make-your-code-ready-for-publication/astronaut-analysis.git -b check-final-results Checking compliance with fair-software.eu... url: https://gitlab.com/hifis/hifis-workshops/make-your-code-ready-for-publication/astronaut-analysis.git branch: check-final-results

Did not find a README[.md|.rst] file at https://gitlab.com/hifis/hifis-workshops/-/raw/check-final-results/ Proceeding without it -- expect the compliance to suffer.

(1/5) repository ▒ has_open_repository (2/5) license ▒ has_license (3/5) registry ▒ has_ascl_badge ▒ has_bintray_badge ▒ has_conda_badge ▒ has_cran_badge ▒ has_crates_badge ▒ has_maven_badge ▒ has_npm_badge ▒ has_pypi_badge ▒ has_rsd_badge ▒ is_on_github_marketplace (4/5) citation ▒ has_citation_file ▒ has_citationcff_file ▒ has_codemeta_file ▒ has_zenodo_badge ▒ has_zenodo_metadata_file (5/5) checklist ▒ has_core_infrastructures_badge

In case you cannot see it, instead of a status symbol there is a grey checkered box.

fdiblen commented 3 years ago

Hi @caha42,

Thank you for reporting this. @jspaaks and me tried it on Windows 10 with Python 3.9 (from the Microsoft Store) using Git Bash (installed Git Bash from https://gitforwindows.org).

We could reproduce your issue (see the screenshot below). image

Solution:

export PYTHONIOENCODING=UTF-8
export PYCHARM_HOSTED="Trick colorama into displaying colored output"

After setting these environment variables, the output looks much better. image

Let us know if that solves your issue.

caha42 commented 3 years ago

Yes, that fixed it. Thank you very much!