Closed
Description
-
[ x] I am on the latest Poetry version.
-
[x ] I have searched the issues of this repo and believe that this is not a duplicate.
-
[ x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: Fedora 34
-
Poetry version: 1.1.5
-
**Link of a Gist
Issue
When adding a git repo that includes a hyphen in the org/path poetry fails to add with an error:
TypeError
expected string or bytes-like object
at ~/.local/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("-", "_")