> cz bump --changelog
bump: version 0.4.0 → 0.5.0
tag to create: 0.5.0
increment detected: MINOR
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\hendra11\Code\external\cz-emoji\.venv\Scripts\cz.exe\__main__.py", line 7, in <module>
File "C:\Users\hendra11\Code\external\cz-emoji\.venv\lib\site-packages\commitizen\cli.py", line 382, in main
args.func(conf, vars(args))()
File "C:\Users\hendra11\Code\external\cz-emoji\.venv\lib\site-packages\commitizen\commands\bump.py", line 215, in __call__
changelog_cmd()
File "C:\Users\hendra11\Code\external\cz-emoji\.venv\lib\site-packages\commitizen\commands\changelog.py", line 172, in __call__
self.write_changelog(changelog_out, lines, changelog_meta)
File "C:\Users\hendra11\Code\external\cz-emoji\.venv\lib\site-packages\commitizen\commands\changelog.py", line 103, in write_changelog
changelog_file.write(changelog_out)
File "C:\Program Files\Python38\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 '\U0001f389' in position 29: character maps to <undefined>
Description
This is because
commitizen_emojiuses unicode emoji characters, butcommitizendoes not specify the file encoding inwrite_changelog(), so it defaults back tocp1252:commitizen/commitizen/commands/changelog.py
Line 92 in 7916511
This could be fixed by specifying the
utf-8encoding:Steps to reproduce
Current behavior
See
Steps to reproduceDesired behavior
Emojis can be logged to changelog
Screenshots
No response
Environment