Invalid author string. Must be in the format: John Smith <[email protected]>
Package:
poetry
16152

Exception Class:
ValueError
Raise code
or = author or default
if author in ["n", "no"]:
return
m = AUTHOR_REGEX.match(author)
if not m:
raise ValueError(
"Invalid author string. Must be in the format: "
"John Smith <[email protected]>"
)
return author
def _validate_license(self, license: str) -> str:
from
Links to the raise (1)
https://github.com/python-poetry/poetry/blob/9591e88492508d4dba260952d53266a0032c04c7/poetry/console/commands/init.py#L537Ways to fix
Summary: author string must be in the format "John Smith <[email protected]>", name goes before the email with a space in-between and the email is wrapped using <>
To reproduce error:
pipenv install poetry
from poetry.console.commands.init import InitCommand
i = InitCommand
author = "<[email protected]> Joe Swanson"
default = ""
print(i._validate_author(i, author, default))
Working Code:
from poetry.console.commands.init import InitCommand
i = InitCommand
author = "Joe Swanson <[email protected]>"
default = ""
print(i._validate_author(i, author, default))
Outputs:
Joe Swanson <[email protected]>
Add a possible fix
Please authorize to post fix