Skip to content

self.status = '\n'.join([self.status, "key considered"]) - TypeError: sequence item 0: expected str instance, NoneType found #292

@waterflow80

Description

@waterflow80

There's an unexpected behavior when running gpg.verify_file(..), I'm getting:

Traceback (most recent call last):
  File "/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File ".../venv/lib/python3.8/site-packages/gnupg/_meta.py", line 650, in _read_response
    result._handle_status(keyword, value)
  File ".../venv/lib/python3.8/site-packages/gnupg/_parsers.py", line 1505, in _handle_status
    self.status = '\n'.join([self.status, "key considered"])
TypeError: sequence item 0: expected str instance, NoneType found

I think the problem is here:

   elif key == "KEY_CONSIDERED":
            self.status = '\n'.join([self.status, "key considered"])
...

Not sure why @coilysiren did it that way in this commit.

I fixed it when like this:

elif key == "KEY_CONSIDERED":
self.status = "key considered"

which is the same way self.status is assigned for all other values of self.key.

I'll make a PR for this, but it seems like the project has been inactive for a while now, so I think it is worth using the original
python-gnupg instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions