Poetry: Unhandled AttributeError in 'poetry install': 'NoneType' object has no attribute 'group'

Created on 10 Jun 2020  路  2Comments  路  Source: python-poetry/poetry

  • [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).
  • macOS-10.15.5:
  • 1.0.9:

pyproject.toml

[tool.poetry]
name = "uncolor"
version = "0.1.0"
description = "strips ANSI colors from a data stream"
authors = ["Ryan Delaney <[email protected]"]
classifiers = [ ]

[tool.poetry.dependencies]
python = "^3.7"
ansicolors = "^1.1.8"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
black = "19.10b0"
flake8 = "^3.8.3"
flake8-breakpoint = "^1.1.0"
flake8-bugbear = "^20.1.4"
flake8-builtins = "^1.5.3"
pytest-mock = "^3.1.1"
pytest-icdiff = "^0.5"

[tool.poetry.scripts]
foo = "uncolor:main"

[tool.black]
line-length = 79
target_version = ["py37"]

[tool.isort]
[settings]
combine_star = true
# default_section =
# force_to_top =
# forced_separate =
include_trailing_comma = true
indent='    '
known_first_party = []
known_third_party = []
length_sort = false
line_length = 79
multi_line_output = 3
# no_lines_before =
# skip =
# skip_glob =
use_parentheses = true
# verbose =

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

Issue

Possibly related to #2372

When performing poetry install using this pyproject.toml file, I am met with an AttributeError:

$ poetry install -vvv
Using virtualenv: /Users/ryan/src/me/uncolor/.venv
Installing dependencies from lock file

No dependencies to install or update

  - Skipping zipp (3.1.0) Already installed
  - Skipping importlib-metadata (1.6.1) Already installed
  - Skipping pyparsing (2.4.7) Already installed
  - Skipping six (1.15.0) Already installed
  - Skipping atomicwrites (1.4.0) Not needed for the current environment
  - Skipping attrs (19.3.0) Already installed
  - Skipping colorama (0.4.3) Not needed for the current environment
  - Skipping mccabe (0.6.1) Already installed
  - Skipping more-itertools (8.3.0) Already installed
  - Skipping packaging (20.4) Already installed
  - Skipping pluggy (0.13.1) Already installed
  - Skipping py (1.8.1) Already installed
  - Skipping pycodestyle (2.6.0) Already installed
  - Skipping pyflakes (2.2.0) Already installed
  - Skipping wcwidth (0.2.4) Already installed
  - Skipping appdirs (1.4.4) Already installed
  - Skipping click (7.1.2) Already installed
  - Skipping flake8 (3.8.3) Already installed
  - Skipping flake8-plugin-utils (1.3.0) Already installed
  - Skipping icdiff (1.9.1) Already installed
  - Skipping pathspec (0.8.0) Already installed
  - Skipping pprintpp (0.4.0) Already installed
  - Skipping pytest (5.4.3) Already installed
  - Skipping regex (2020.6.8) Already installed
  - Skipping toml (0.10.1) Already installed
  - Skipping typed-ast (1.4.1) Already installed
  - Skipping ansicolors (1.1.8) Already installed
  - Skipping black (19.10b0) Already installed
  - Skipping flake8-breakpoint (1.1.0) Already installed
  - Skipping flake8-bugbear (20.1.4) Already installed
  - Skipping flake8-builtins (1.5.3) Already installed
  - Skipping pytest-icdiff (0.5) Already installed
  - Skipping pytest-mock (3.1.1) Already installed

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

Traceback (most recent call last):
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/commands/install.py", line 78, in handle
    builder = EditableBuilder(self.poetry, self._env, NullIO())
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/masonry/builders/builder.py", line 71, in __init__
    self._meta = Metadata.from_package(self._package)
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/masonry/metadata.py", line 54, in from_package
    meta.author = package.author_name
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/packages/package.py", line 138, in author_name
    return self._get_author()['name']
  File "/Users/ryan/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/packages/package.py", line 166, in _get_author
    name = m.group('name')

Duplicate Error Handling

Most helpful comment

Hello @rpdelaney,

this is essentialy a duplicate of https://github.com/python-poetry/poetry/issues/1143, because you have a malformed author:

authors = ["Ryan Delaney <[email protected]"]

must become

authors = ["Ryan Delaney <[email protected]>"]

But yes, we have to improve the error message here.

fin swimmer

All 2 comments

Hello @rpdelaney,

this is essentialy a duplicate of https://github.com/python-poetry/poetry/issues/1143, because you have a malformed author:

authors = ["Ryan Delaney <[email protected]"]

must become

authors = ["Ryan Delaney <[email protected]>"]

But yes, we have to improve the error message here.

fin swimmer

In my case, I was using backticks:

authors = ["M `Pax` Williams <[email protected]>"]

must be changed to:

```
authors = ["M 'Pax' Williams myemail@gmail.com"]

Was this page helpful?
0 / 5 - 0 ratings