Skip to content

'ë' in author name raise an error during poetry install #2004

Closed

Description

@raphaelyancey

Issue

$ poetry install -v

Using virtualenv: /Users/raphael/Library/Caches/pypoetry/virtualenvs/pyky040-oonWdb9N-py3.7
Installing dependencies from lock file

No dependencies to install or update

  - Skipping zipp (1.1.0) Already installed
  - Skipping importlib-metadata (1.5.0) Already installed
  - Skipping pyparsing (2.4.6) Already installed
  - Skipping six (1.14.0) Already installed
  - Skipping atomicwrites (1.3.0) Already installed
  - Skipping attrs (19.3.0) Already installed
  - Skipping colorama (0.4.3) Not needed for the current environment
  - Skipping more-itertools (8.2.0) Already installed
  - Skipping packaging (20.1) Already installed
  - Skipping pluggy (0.13.1) Already installed
  - Skipping py (1.8.1) Already installed
  - Skipping wcwidth (0.1.8) Already installed
  - Skipping pytest (4.6.9) Already installed
  - Not removing pathlib2 (2.3.5) Not currently installed

[AttributeError]
'NoneType' object has no attribute 'group'

Traceback (most recent call last):
  File "/Users/raphael/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/raphael/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/raphael/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/raphael/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/raphael/.poetry/lib/poetry/console/commands/install.py", line 72, in handle
    builder = EditableBuilder(self.poetry, self._env, NullIO())
  File "/Users/raphael/.poetry/lib/poetry/masonry/builders/builder.py", line 70, in __init__
    self._meta = Metadata.from_package(self._package)
  File "/Users/raphael/.poetry/lib/poetry/masonry/metadata.py", line 54, in from_package
    meta.author = package.author_name
  File "/Users/raphael/.poetry/lib/poetry/packages/package.py", line 137, in author_name
    return self._get_author()['name']
  File "/Users/raphael/.poetry/lib/poetry/packages/package.py", line 165, in _get_author
    name = m.group('name')

The error is gone when I replace ë by e in my name in pyproject.toml.

Activity

  1. changed the title [-]Accented character in author name raise an error during `poetry install`[/-] [+]'ë' in author name raise an error during `poetry install`[/+] on Feb 8, 2020
  2. raphaelyancey commented on Feb 9, 2020

    @raphaelyancey
    ContributorAuthor

    Minimal example:

    In [1]: import re
    
    In [2]: AUTHOR_REGEX = re.compile(r"(?u)^(?P<name>[- .,\w\d'’\"()]+)(?: <(?P<email>.+?)>)?$")
    
    In [3]: r = "Raphaël Yancey <raphael@badfile.net>"
    
    In [4]: s = "Sébastien Eustace <sebastien@eustace.io>"
    
    In [5]: AUTHOR_REGEX.match(r).group("name")
    AttributeError: 'NoneType' object has no attribute 'group'
    
    In [6]: AUTHOR_REGEX.match(s).group("name")
    Out[6]: 'Sébastien Eustace'

    So this might be not on poetry but rather on re behavior (re.LOCALE / re.UNICODE maybe?). Will make further tests later.

  3. added a commit that references this issue on Feb 28, 2020
    ae6d64d
  4. added a commit that references this issue on Mar 20, 2020
    8224b16
  5. github-actions commented on Mar 3, 2024

    @github-actions

    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.

  6. locked as resolved and limited conversation to collaborators on Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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