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

delocate errors out when wheel has paths with dir/file names in korean characters #189

Closed
ankith26 opened this issue Nov 14, 2023 · 3 comments
Labels

Comments

@ankith26
Copy link

Here is the bug and the corresponding traceback

+ delocate-wheel --require-archs x86_64 -w /private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/repaired_wheel -v /private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/built_wheel/pygame_ce-2.4.0.dev3-cp39-cp39-macosx_10_11_x86_64.whl
Fixing: /private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/built_wheel/pygame_ce-2.4.0.dev3-cp39-cp39-macosx_10_11_x86_64.whl
Traceback (most recent call last):
  File "/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/build/venv/bin/delocate-wheel", line 8, in <module>
    sys.exit(main())
  File "/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/cmd/delocate_wheel.py", line 127, in main
    copied = delocate_wheel(
  File "/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/delocating.py", line 637, in delocate_wheel
    zip2dir(in_wheel, wheel_dir)
  File "/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/tools.py", line 794, in zip2dir
    _run(["unzip", "-o", "-d", out_dir, zip_fname], check=True)
  File "/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/cibw-run-hd34nacc/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/tools.py", line 136, in _run
    return subprocess.run(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1134, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 2017, in _communicate
    stdout = self._translate_newlines(stdout,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1011, in _translate_newlines
    data = data.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 43001-43002: invalid continuation byte

This crash started happening when I tried to include certain files in the wheel that had korean characters in the paths. And when I removed said files, delocate started working as usual.

Platform:

  • OS version: 12
  • Delocate version: 0.10.4
    issue happens on both x86_64 and arm64
@ankith26 ankith26 added the bug label Nov 14, 2023
@ankith26
Copy link
Author

Going through commit history, I see changes related to this, has this been fixed on main?

@HexDecimal
Copy link
Collaborator

The changelog has an unreleased fix related to encoding, so this might be fixed on main.

You can install directly from main using this command: pip install git+https:/matthew-brett/delocate.git

@ankith26
Copy link
Author

That does indeed fix the issue, thanks!

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

No branches or pull requests

2 participants