Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

UnicodeDecodeError in dephell deps convert #465

Open
abersheeran opened this issue Sep 16, 2020 · 0 comments · May be fixed by #466
Open

UnicodeDecodeError in dephell deps convert #465

abersheeran opened this issue Sep 16, 2020 · 0 comments · May be fixed by #466

Comments

@abersheeran
Copy link

Short description

I am using Windows 10, and the language is set to Chinese. The default encoding for Python opening files is gbk, but it should be specified as utf8.

Output

➜ dephell deps convert
ERROR UnicodeDecodeError: 'gbk' codec can't decode byte 0x82 in position 553: illegal multibyte sequence

Steps to reproduce

$ git clone https://github.com/abersheeran/websocks
$ cd websocks
$ git checkout dev
$ dephell deps convert

Traceback

➜ dephell deps convert --traceback
ERROR UnicodeDecodeError: 'gbk' codec can't decode byte 0x82 in position 553: illegal multibyte sequence 
Traceback (most recent call last):
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\cli.py", line 66, in main
    result = handler()
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\commands\deps_convert.py", line 91, in __call__
    dumper.dump(path=self.config['to']['path'], **dumper_kwargs)
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\converters\base.py", line 74, in dump
    content = self.dumps(reqs=reqs, content=content, project=project)
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\converters\setuppy.py", line 230, in dumps
    readme = project.readme.to_rst().as_code()
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\controllers\_readme.py", line 87, in to_rst
    new_path.write_text(self.as_rst())
  File "c:\users\abers\.local\pipx\venvs\dephell\lib\site-packages\dephell\controllers\_readme.py", line 76, in as_rst
    content = convert(self.path.read_text())
  File "c:\users\abers\appdata\local\programs\python\python37\lib\pathlib.py", line 1207, in read_text
    return f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x82 in position 553: illegal multibyte sequence

Config

[tool.dephell.main]
from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}

Versions

➜ dephell inspect self
{
  "cache": "166.84Kb",
  "path": "c:\\users\\abers\\.local\\pipx\\venvs\\dephell\\lib\\site-packages\\dephell",
  "python": "c:\\users\\abers\\.local\\pipx\\venvs\\dephell\\scripts\\python.exe",
  "version": "0.8.3",
  "versions": {
    "dephell-archive": "0.1.7",
    "dephell-argparse": "0.1.3",
    "dephell-changelogs": "0.0.1",
    "dephell-discover": "0.2.10",
    "dephell-licenses": "0.1.7",
    "dephell-links": "0.1.5",
    "dephell-markers": "1.0.3",
    "dephell-pythons": "0.1.15",
    "dephell-setuptools": "0.2.4",
    "dephell-shells": "0.1.5",
    "dephell-specifier": "0.2.2",
    "dephell-venvs": "0.1.17",
    "dephell-versioning": "0.1.2"
  }
}
@abersheeran abersheeran linked a pull request Sep 16, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant