Closed markus-work closed 7 months ago
Hey @markus-work, thanks for the report!
On mobile right now, sorry for the short answer: does it work if you set the following environment variable?
PYTHONUTF8=1
Or this less modern one:
PYTHONIOENCODING=UTF-8
Thanks for the quick reply!
Yes, it does work for PYTHONUTF8=1
. Not for PYTHONIOENCODING=UTF-8
.
Sorry I meant PYTHONIOENCODING=UTF8
(mobile auto-correction...). But in any case, since PYTHONUTF8=1
makes it work, I'll consider it to be the solution. I very rarely encounter Python tools providing an encoding
CLI flag or API option. Therefore I'll close your PR, I hope you don't mind :slightly_smiling_face: Feel free to comment further of course!
Description of the bug
Outputing changelog to file with conventional commits and a non-ascii character in the commit message will result in the error:
To Reproduce
git-changelog --config-file config/git-changelog-md.toml
'charmap' codec can't encode character
git-changelog --config-file config/git-changelog-no-output.toml
pip install -r requirements-fixed.txt
git-changelog --config-file config/git-changelog-md.toml
Full traceback
Full traceback
```sh $ git-changelog --config-file config/git-changelog-md.toml git-changelog: 'charmap' codec can't encode character '\u2795' in position 212: character maps toExpected behavior
Changelog generated as normal.
Environment information
Additional context
I have also reproduced it once in the actions, but I can't get it reliably to be reproduced. Locally on my machine it happens every time.
I have explicitly set the encoding here, and that works every time: https://github.com/markus-work/git-changelog / https://github.com/pawamoy/git-changelog/pull/84