Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
se-jaeger opened this issue Jul 6, 2021 · 9 comments
Closed
3 tasks done

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

se-jaeger opened this issue Jul 6, 2021 · 9 comments
Labels
kind/bug Something isn't working as expected

Comments

@se-jaeger
Copy link

se-jaeger commented Jul 6, 2021

  • 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│
@se-jaeger se-jaeger added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 6, 2021
@finswimmer
Copy link
Member

Hello @se-jaeger,

unfortunately I'm not able to reproduce your problem.

So let's try with the default questions :)

  • How did you install poetry?
  • How was the pyproject.toml created?
  • Which text editor are using if you manipulate the file by hand?
  • Which shell are you using?

fin swimmer

@se-jaeger
Copy link
Author

Hey @finswimmer,

thanks for your quick answer!

Regarding your questions:

  • installed using brew: brew install poetry
  • poetry new project-name
  • I'm using VSCodium
  • and zsh

@finswimmer
Copy link
Member

Could you upload your pyproject.toml somewhere? I suspect an encoding problem of the file, which would make it hard/impossible to debug if you just paste the content here.

@se-jaeger
Copy link
Author

It is directly after creating the project:

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

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

But you're right, removing the ä with VSCode solves it.

@finswimmer
Copy link
Member

Maybe related? #798

@se-jaeger
Copy link
Author

Confirmed! It's the ~/.gitconfig file with broken encoding. Poetry then copies this over without checking it.

@srinivasreddy
Copy link

This can be closed?

@se-jaeger
Copy link
Author

Sure. Thought someone wants to investigate this further or even fix it.
Thanks a lot!

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants