Skip to content

Section tool.poetry.authors does not accept umlauts (ä, ö, ü) #4258

@se-jaeger

Description

@se-jaeger
  • 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: macOS 11.4
  • Poetry version: 1.1.7

Issue

I'm using the following section:

[tool.poetry]
...
authors = ["Sebastian Jäger <message@sebastian-jaeger.me>"]

and ran: poetry build
This failed with the message: (...) Invalid author string. Must be in the format: John Smith <john@example.com> (...)

Replacing ä with ae works as expected.

In my opinion the error should be more descriptive, e.g.: (...) Invalid author string. Must be in the format: John Smith <john@example.com> and should not contain special characters(/ umlauts) (...)

Full Stack Trace

-> poetry build -vvv

  Stack trace:

  9  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/clikit/console_application.py:131 in run
      129│             parsed_args = resolved_command.args
      130│
    → 131│             status_code = command.handle(parsed_args, io)
      132│         except KeyboardInterrupt:
      133│             status_code = 1

  8  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/clikit/api/command/command.py:120 in handle
      118│     def handle(self, args, io):  # type: (Args, IO) -> int
      119│         try:
    → 120│             status_code = self._do_handle(args, io)
      121│         except KeyboardInterrupt:
      122│             if io.is_debug():

  7  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/clikit/api/command/command.py:171 in _do_handle
      169│         handler_method = self._config.handler_method
      170│
    → 171│         return getattr(handler, handler_method)(args, io, self)
      172│
      173│     def __repr__(self):  # type: () -> str

  6  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/cleo/commands/command.py:92 in wrap_handle
       90│         self._command = command
       91│
    →  92│         return self.handle()
       93│
       94│     def handle(self):  # type: () -> Optional[int]

  5  /usr/local/Cellar/poetry/1.1.7/libexec/lib/python3.9/site-packages/poetry/console/commands/build.py:36 in handle
      34│
      35│         builder = Builder(self.poetry)
    → 36│         builder.build(fmt, executable=self.env.python)
      37│

  4  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/poetry/core/masonry/builder.py:35 in build
      33│
      34│         for builder in builders:
    → 35│             builder(self._poetry, executable=executable).build()
      36│

  3  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/poetry/core/masonry/builders/builder.py:92 in __init__
       90│         )
       91│
    →  92│         self._meta = Metadata.from_package(self._package)
       93│
       94│     @property

  2  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/poetry/core/masonry/metadata.py:60 in from_package
      58│         meta.keywords = ",".join(package.keywords)
      59│         meta.home_page = package.homepage or package.repository_url
    → 60│         meta.author = package.author_name
      61│         meta.author_email = package.author_email
      62│

  1  /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/poetry/core/packages/package.py:172 in author_name
      170│     @property
      171│     def author_name(self):  # type: () -> str
    → 172│         return self._get_author()["name"]
      173│
      174│     @property

  ValueError

  Invalid author string. Must be in the format: John Smith <john@example.com>

  at /usr/local/Cellar/poetry/1.1.7/libexec/vendor/lib/python3.9/site-packages/poetry/core/packages/package.py:203 in _get_author
      199│
      200│         m = AUTHOR_REGEX.match(self._authors[0])
      201│
      202│         if m is None:
    → 203│             raise ValueError(
      204│                 "Invalid author string. Must be in the format: "
      205│                 "John Smith <john@example.com>"
      206│             )
      207│

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