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

maturin develop failed on Windows because of utf-8 encoding error #952

Closed
2 tasks done
bachue opened this issue Jun 6, 2022 · 3 comments · Fixed by #953
Closed
2 tasks done

maturin develop failed on Windows because of utf-8 encoding error #952

bachue opened this issue Jun 6, 2022 · 3 comments · Fixed by #953
Labels
bug Something isn't working

Comments

@bachue
Copy link

bachue commented Jun 6, 2022

Bug Description

I'm developing a PyO3 project. Actually this project works well on Linux / Mac, but failed on Windows 10.

Untitled

I have no idea which file includes invalid utf-8 character.

Your Python version (python -V)

python 3.10.4

Your pip version (pip -V)

pip 22.1.2

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

Run these commands on Powershell

git clone git@github.com:bachue/rust-sdk-python-bindings.git
cd rust-sdk-python-bindings
.\.env\Scripts\Activate.ps1
.\.env\Scripts\python.exe -m pip install pip --upgrade
.\.env\Scripts\python.exe -m pip install ".[tests]"
maturin.exe develop

Then failed just like the snapshot.

@bachue bachue added the bug Something isn't working label Jun 6, 2022
@messense
Copy link
Member

messense commented Jun 6, 2022

I think the error may caused by one of the following lines

str::from_utf8(&output.stdout)?.trim(),

str::from_utf8(&output.stderr)?.trim(),

str::from_utf8(&output.stderr)?.trim(),

Could you debug it? I don't have a reproducible Windows environment.

@bachue
Copy link
Author

bachue commented Jun 6, 2022

image
Ok, I got the reason now, running PowerShell with Administrator could resolve it.

@bachue bachue closed this as completed Jun 6, 2022
@messense
Copy link
Member

messense commented Jun 6, 2022

Reopening because we should provide a better error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants