Page MenuHome GnuPG

Error in decrypt_file function
Closed, InvalidPublic

Description

I am using gnupg for decrypting a file and getting an error mentioned below, though file is being decrypted properly. Below is the error and environment.

Traceback (most recent call last):

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
  self.__target(*self.__args, **self.__kwargs)
File "/Users/pammy/venvs/common-ingestion/lib/python2.7/site-packages/gnupg/_meta.py", line 650, in _read_response
  result._handle_status(keyword, value)
File "/Users/pammy/venvs/common-ingestion/lib/python2.7/site-packages/gnupg/_parsers.py", line 1757, in _handle_status
  super(Crypt, self)._handle_status(key, value)
File "/Users/pammy/venvs/common-ingestion/lib/python2.7/site-packages/gnupg/_parsers.py", line 1656, in _handle_status
  raise ValueError("Unknown status message: %r" % key)

ValueError: Unknown status message: u'DECRYPTION_KEY'

Environment Details:
OS: macOS High Sierra version 10.13.3
Python 2.7.10
python package gnupg==2.3.1
gpg (GnuPG) 2.2.10

Details

Version
2.2.10

Event Timeline

From where did you go that "python package gnupg==2.3.1" ?
Sorry, I can see what kind of Python code this is. It is not part of GnuPG, though.

from pip i used command
pip install gnupg

That is a different python binding than what we provide with gpgme. Our gpgme based binding is called "gpg" and was formerly known as "pyme". I strongly suggest to install gpgme and not to use pip because the "gpg" module over there has not been updated for quite some time.