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

Error with non-ascii characters in pyproject.toml #308

Closed
1 task done
abersheeran opened this issue Mar 18, 2021 · 0 comments · Fixed by #309
Closed
1 task done

Error with non-ascii characters in pyproject.toml #308

abersheeran opened this issue Mar 18, 2021 · 0 comments · Fixed by #309
Labels
🐛 bug Something isn't working

Comments

@abersheeran
Copy link
Contributor

  • I have searched the issue tracker and believe that this is not a duplicate.
Failed to build package, try parsing project files.
Error occurs
Traceback (most recent call last):
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\models\builders.py", line 146, in __init__
    spec = toml.load(f)
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\toml\decoder.py", line 156, in load
    return loads(f.read(), _dict, decoder)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 181: illegal multibyte sequence

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\iostream.py", line 140, in logging
    yield logger
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\installers\synchronizers.py", line 336, in synchronize
    handlers[install_self[0]](install_self[1])
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\installers\synchronizers.py", line 146, in install_candidate
    installer.install(can)
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\installers\installers.py", line 46, in install
    self.install_editable(candidate.ireq)
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\installers\installers.py", line 71, in install_editable
    with EnvBuilder(ireq.unpacked_source_directory, self.environment) as builder:
  File "c:\users\aber\.local\pipx\venvs\pdm\lib\site-packages\pdm\models\builders.py", line 150, in __init__
    raise BuildError(e) from e
pdm.exceptions.BuildError: 'gbk' codec can't decode byte 0xac in position 181: illegal multibyte sequence

Steps to reproduce

Write any non-ASCII characters in the pyproject.toml.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:        1.4.2
Python Interpreter: C:/Users/Aber/AppData/Local/Programs/Python/Python39/python.exe (3.9.2)
Project Root:       C:/Users/Aber/Documents/xxx
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.2",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.19041",
  "python_full_version": "3.9.2",
  "platform_python_implementaiton": "CPython",
  "python_version": "3.9",
  "sys_platform": "win32"
}
@abersheeran abersheeran added the 🐛 bug Something isn't working label Mar 18, 2021
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.

1 participant