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

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

Open
waterflow80 opened this issue Jun 3, 2024 · 0 comments · May be fixed by #293

Comments

@waterflow80
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant