Skip to content

got a expected string or bytes-like object when running install #4311

@ElricleNecro

Description

@ElricleNecro
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Arch Linux
  • Poetry version: 1.1.7
  • [tool.poetry]
    name = "testy"
    version = "0.1.0"
    description = ""
    authors = ["Test user"]
    
    [tool.poetry.dependencies]
    python = ">=3.7,<4.0"
    dgl = [
    	{ git = "https://github.com/dmlc/dgl.git", tag = "v0.7.0", markers = "sys_platform == 'linux'"},
    	{ version="^0.7", markers = "sys_platform == 'darwin'"}
    ]
    
    [build-system]
    requires = ["poetry-core>=1.0.0"]
    build-backend = "poetry.core.masonry.api"

Issue

When using this pyproject.toml, I get the following exception:

  TypeError

  expected string or bytes-like object

  at /usr/lib/python3.9/site-packages/poetry/core/utils/helpers.py:27 in canonicalize_name
       23│ _canonicalize_regex = re.compile(r"[-_]+")
       24│ 
       25│ 
       26│ def canonicalize_name(name):  # type: (str) -> str
    →  27│     return _canonicalize_regex.sub("-", name).lower()
       28│ 
       29│ 
       30│ def module_name(name):  # type: (str) -> str
       31│     return canonicalize_name(name).replace(".", "_").replace("-", "_")

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions