Skip to content

Fixed a bug where file encoding was not specified. #721

@APLaS-Plus

Description

@APLaS-Plus

this is the error when I'm installing the repo:

(ovos-core) PS C:\Users\lzw20\Desktop\ovos-core> uv pip install .
error: The build backend returned an error
  Caused by: Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit code: 1)

[stderr]
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "C:\Users\lzw20\AppData\Local\uv\cache\builds-v0\.tmpx2S5VA\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel    return self._get_build_requires(config_settings, requirements=[])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\lzw20\AppData\Local\uv\cache\builds-v0\.tmpx2S5VA\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
    self.run_setup()
  File "C:\Users\lzw20\AppData\Local\uv\cache\builds-v0\.tmpx2S5VA\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup      
    super().run_setup(setup_script=setup_script)
  File "C:\Users\lzw20\AppData\Local\uv\cache\builds-v0\.tmpx2S5VA\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup      
    exec(code, locals())
  File "<string>", line 57, in <module>
UnicodeDecodeError: 'gbk' codec can't decode byte 0x8f in position 622: illegal multibyte sequence

hint: This usually indicates a problem with the package or the build environment.

I have updated the open() function in setup.py to use UTF-8 encoding, which resolves the decoding error.

old code with open(version_file) as f:
new code with open(version_file, encoding="utf-8") as f:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions