haystack icon indicating copy to clipboard operation
haystack copied to clipboard

`reno` might fail generating release notes file when using some encoding

Open silvanocerza opened this issue 1 year ago • 3 comments

Original message below.

@Lord-Haji would you please add reno release note, see Contributing guide for instructions. Also adding a few unit test will significantly speed up integration of this PR 🙏

Hi @vblagoje I tried generating release notes but kept encountering weird issues while attempting to run it. I'll retry it later but it seemed to me there was some sort of UTF-8 decode error. I am on Windows

Idk if this is dumb but I'm attaching the traceback too if in case someone can help out. here since I can't really figure out a shortcut fix to this

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "E:\haystack\venv\bin\reno.exe\__main__.py", line 7, in <module>
  File "E:\haystack\venv\lib\python3.11\site-packages\reno\main.py", line 225, in main
    conf = config.Config(args.reporoot, args.relnotesdir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\haystack\venv\lib\python3.11\site-packages\reno\config.py", line 335, in __init__
    self._load_file()
  File "E:\haystack\venv\lib\python3.11\site-packages\reno\config.py", line 352, in _load_file
    self._contents = yaml.safe_load(fd)
                     ^^^^^^^^^^^^^^^^^^
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\__init__.py", line 79, in load
    loader = Loader(stream)
             ^^^^^^^^^^^^^^
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\reader.py", line 85, in __init__
    self.determine_encoding()
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\reader.py", line 124, in determine_encoding
    self.update_raw()
  File "E:\haystack\venv\lib\python3.11\site-packages\yaml\reader.py", line 178, in update_raw
    data = self.stream.read(size)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\msys64\mingw64\lib\python3.11\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1826: character maps to <undefined>

Originally posted by @Lord-Haji in https://github.com/deepset-ai/haystack/issues/7303#issuecomment-1978814122

silvanocerza avatar Mar 06 '24 10:03 silvanocerza

the emojis in the releasenotes/config.yaml are the one causing issues. Current workaround for Windows users is it enable UTF-8 system wide via intl.cpl Link to Stackoverflow thread.

I believe this should be added to CONTRIBUTING.md

Lord-Haji avatar Mar 07 '24 08:03 Lord-Haji

Nice investigative work @Lord-Haji !!

vblagoje avatar Mar 07 '24 14:03 vblagoje

I would just remove the emojis to be honest

masci avatar Mar 07 '24 18:03 masci