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

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

Closed
3 tasks done
rpdelaney opened this issue Jun 10, 2020 · 6 comments
Closed
3 tasks done
Labels
area/error-handling Bad error messages/insufficient error handling status/duplicate Duplicate issues

Comments

@rpdelaney
Copy link
Contributor

rpdelaney commented Jun 10, 2020

  • 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).
  • 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 <ryan.patrick.delaney@protonmail.com"]
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')
@rpdelaney rpdelaney added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 10, 2020
@finswimmer finswimmer added the area/error-handling Bad error messages/insufficient error handling label Jun 11, 2020
@finswimmer
Copy link
Member

Hello @rpdelaney,

this is essentialy a duplicate of #1143, because you have a malformed author:

authors = ["Ryan Delaney <ryan.patrick.delaney@protonmail.com"]

must become

authors = ["Ryan Delaney <ryan.patrick.delaney@protonmail.com>"]

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

fin swimmer

@finswimmer finswimmer added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged kind/bug Something isn't working as expected labels Jun 11, 2020
@paxcodes
Copy link

In my case, I was using backticks:

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

must be changed to:

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

@bostevensspinakr
Copy link

bostevensspinakr commented Feb 2, 2022

Hi, I have a similar error.

'NoneType' object has no attribute 'closed'

at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\clikit\io\output_stream\stream_output_stream.py:116 in is_closed

This is my authors line:

authors = ["Bo Stevens <bo.stevens@spinakrsolutions.com>"]

I don't see anything wrong with it.

@paxcodes
Copy link

paxcodes commented Feb 2, 2022

@bostevensspinakr The error does have a similar wording but it looks like an error within the clikit package (or perhaps how your application is using that package). I'd say it's not related to poetry.

@btonasse
Copy link

btonasse commented Feb 13, 2022

I have the same error as @bostevensspinakr , but when trying to run poetry init. It therefore has nothing to do with my application

EDIT: just realized this only happens in bash for windows.

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
area/error-handling Bad error messages/insufficient error handling status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

5 participants