Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project author name cause UnicodeEncodeError while writing package on Windows #1

Closed
davidlatwe opened this issue Aug 9, 2020 · 1 comment

Comments

@davidlatwe
Copy link
Owner

Invoking custom build system...
Running build command: python C:\Users\david\dev\rez-packages\Qt.rez/rezbuild.py install
Traceback (most recent call last):
  File "C:\Python36_64\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python36_64\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\david\rez\core\Scripts\rez\rez-build.exe\__main__.py", line 7, in <module>
  File "c:\users\david\rez\core\lib\site-packages\rez\cli\_entry_points.py", line 110, in run_rez_build
    return run("build")
  File "c:\users\david\rez\core\lib\site-packages\rez\cli\_main.py", line 160, in run
    returncode = run_cmd()
  File "c:\users\david\rez\core\lib\site-packages\rez\cli\_main.py", line 152, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
  File "c:\users\david\rez\core\lib\site-packages\rez\cli\build.py", line 157, in command
    variants=opts.variants)
  File "c:\users\david\rez\core\lib\site-packages\rezplugins\build_process\local.py", line 53, in build
    install=install)
  File "c:\users\david\rez\core\lib\site-packages\rez\build_process.py", line 204, in visit_variants
    result = func(variant, **kwargs)
  File "c:\users\david\rez\core\lib\site-packages\rezplugins\build_process\local.py", line 359, in _build_variant
    variant.install(install_path)
  File "c:\users\david\rez\core\lib\site-packages\rez\packages.py", line 449, in install
    overrides=overrides)
  File "c:\users\david\rez\core\lib\site-packages\rezplugins\package_repository\filesystem.py", line 722, in install_variant
    variant = _create_variant()
  File "c:\users\david\rez\core\lib\site-packages\rezplugins\package_repository\filesystem.py", line 715, in _create_variant
    overrides=overrides
  File "c:\users\david\rez\core\lib\site-packages\rezplugins\package_repository\filesystem.py", line 1190, in _create_variant
    dump_package_data(package_data, buf=f, format_=package_format)
  File "C:\Python36_64\Lib\contextlib.py", line 88, in __exit__
    next(self.gen)
  File "c:\users\david\rez\core\lib\site-packages\rez\serialise.py", line 89, in open_file_for_write
    f.write(content)
UnicodeEncodeError: 'cp950' codec can't encode character '\xf6' in position 620: illegal multibyte sequence

This require change in Rez, by adding kwarg encoding="utf-8" into following file open call resolved the problem :

https://github.com/nerdvegas/rez/blob/def201aca819862470b879d5beb75fcf3d46f87f/src/rez/serialise.py#L71-L72

https://github.com/nerdvegas/rez/blob/def201aca819862470b879d5beb75fcf3d46f87f/src/rez/serialise.py#L88-L89

@davidlatwe
Copy link
Owner Author

Fixed in AcademySoftwareFoundation/rez#928, release version 2.64.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant