gnupg.py output

jayshree kalawa jayshree06comp at gmail.com
Thu Sep 17 11:21:27 CEST 2009


hello,
        After executing the gnupg.py module some exception thrown by it .so
i am unable to see what the output it gives.

The output generated by it ,is attached .

Reading the Gnupg documents it is clear to me that it provide encrytion
/decryption and other functionality .
 Is there any solution to use encryption function separately within by
program .

thanks ..
-- 
Jayshree Kalawa

scsmtech2008 at yahoogroups.co.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20090917/e8c9ab01/attachment-0001.htm>
-------------- next part --------------
[jayshree at TestServer ~]$ python test_gnupg.py 
Test that key deletion works ... ok
Test that encryption and decryption works ... ok
Test the environment by ensuring that setup worked ... ok
Test that key import and export works ... ok
Test that after key generation, the generated key is available ... ok
Test that initially there are no keys ... ok
Test that absence of gpg is handled correctly ... ok
Test that signing and verification works ... ok
Doctest: gnupg.GPG.__init__ ... ok
Doctest: gnupg.GPG.encrypt ... Exception in thread Thread-83:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'

Exception in thread Thread-85:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'

Exception in thread Thread-89:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 729, in handle_status
    Verify.handle_status(self, key, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 563, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'NODATA'

Exception in thread Thread-93:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 729, in handle_status
    Verify.handle_status(self, key, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 563, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'NODATA'

Exception in thread Thread-95:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 729, in handle_status
    Verify.handle_status(self, key, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 563, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'NODATA'

Exception in thread Thread-97:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 729, in handle_status
    Verify.handle_status(self, key, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 563, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'NODATA'

Exception in thread Thread-103:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 729, in handle_status
    Verify.handle_status(self, key, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 563, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'NODATA'

FAIL
Doctest: gnupg.GPG.gen_key ... Exception in thread Thread-107:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'

FAIL
Doctest: gnupg.GPG.import_keys ... Exception in thread Thread-113:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'

Exception in thread Thread-115:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'

FAIL
Doctest: gnupg.GPG.list_keys ... Exception in thread Thread-153:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 150, in _read_response
    result.handle_status(keyword, value)
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 752, in handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: 'KEY_NOT_CREATED'
FAIL

======================================================================
FAIL: Doctest: gnupg.GPG.encrypt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for gnupg.GPG.encrypt
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 468, in encrypt

----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 472, in gnupg.GPG.encrypt
Failed example:
    if os.path.exists("/tmp/pygpgtest"):
        shutil.rmtree("/tmp/pygpgtest")
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.encrypt[1]>", line 2, in ?
        shutil.rmtree("/tmp/pygpgtest")
      File "/usr/lib/python2.4/shutil.py", line 155, in rmtree
        onerror(os.listdir, path, sys.exc_info())
      File "/usr/lib/python2.4/shutil.py", line 153, in rmtree
        names = os.listdir(path)
    OSError: [Errno 13] Permission denied: '/tmp/pygpgtest'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 485, in gnupg.GPG.encrypt
Failed example:
    assert result
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.encrypt[13]>", line 1, in ?
        assert result
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 486, in gnupg.GPG.encrypt
Failed example:
    str(result)
Expected:
    'hello'
Got:
    ''
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 491, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'need passphrase'
Got:
    ''
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 494, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'decryption failed'
Got:
    ''
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 498, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'decryption ok'
Got:
    ''
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 500, in gnupg.GPG.encrypt
Failed example:
    str(result)
Expected:
    'hello again'
Got:
    ''
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 503, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'need passphrase'
Got:
    'invalid recipient'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 506, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'encryption ok'
Got:
    'invalid recipient'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 510, in gnupg.GPG.encrypt
Failed example:
    result.status
Expected:
    'decryption ok'
Got:
    ''


======================================================================
FAIL: Doctest: gnupg.GPG.gen_key
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for gnupg.GPG.gen_key
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 384, in gen_key

----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 391, in gnupg.GPG.gen_key
Failed example:
    assert result
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.gen_key[3]>", line 1, in ?
        assert result
    AssertionError


======================================================================
FAIL: Doctest: gnupg.GPG.import_keys
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for gnupg.GPG.import_keys
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 260, in import_keys

----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 264, in gnupg.GPG.import_keys
Failed example:
    shutil.rmtree("/tmp/pygpgtest")
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[1]>", line 1, in ?
        shutil.rmtree("/tmp/pygpgtest")
      File "/usr/lib/python2.4/shutil.py", line 155, in rmtree
        onerror(os.listdir, path, sys.exc_info())
      File "/usr/lib/python2.4/shutil.py", line 153, in rmtree
        names = os.listdir(path)
    OSError: [Errno 13] Permission denied: '/tmp/pygpgtest'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 275, in gnupg.GPG.import_keys
Failed example:
    assert print1 in seckeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[12]>", line 1, in ?
        assert print1 in seckeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 276, in gnupg.GPG.import_keys
Failed example:
    assert print1 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[13]>", line 1, in ?
        assert print1 in pubkeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 277, in gnupg.GPG.import_keys
Failed example:
    str(gpg.delete_keys(print1))
Expected:
    'Must delete secret key first'
Got:
    'No such key'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 279, in gnupg.GPG.import_keys
Failed example:
    str(gpg.delete_keys(print1,secret=True))
Expected:
    'ok'
Got:
    'No such key'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 281, in gnupg.GPG.import_keys
Failed example:
    str(gpg.delete_keys(print1))
Expected:
    'ok'
Got:
    'No such key'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 295, in gnupg.GPG.import_keys
Failed example:
    assert print1 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[28]>", line 1, in ?
        assert print1 in pubkeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 297, in gnupg.GPG.import_keys
Failed example:
    assert result
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[30]>", line 1, in ?
        assert result
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 300, in gnupg.GPG.import_keys
Failed example:
    assert print1 in seckeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[33]>", line 1, in ?
        assert print1 in seckeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 301, in gnupg.GPG.import_keys
Failed example:
    assert print1 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[34]>", line 1, in ?
        assert print1 in pubkeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 302, in gnupg.GPG.import_keys
Failed example:
    assert print2 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.import_keys[35]>", line 1, in ?
        assert print2 in pubkeys.fingerprints
    AssertionError


======================================================================
FAIL: Doctest: gnupg.GPG.list_keys
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for gnupg.GPG.list_keys
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 337, in list_keys

----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 341, in gnupg.GPG.list_keys
Failed example:
    shutil.rmtree("/tmp/pygpgtest")
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.list_keys[1]>", line 1, in ?
        shutil.rmtree("/tmp/pygpgtest")
      File "/usr/lib/python2.4/shutil.py", line 155, in rmtree
        onerror(os.listdir, path, sys.exc_info())
      File "/usr/lib/python2.4/shutil.py", line 153, in rmtree
        names = os.listdir(path)
    OSError: [Errno 13] Permission denied: '/tmp/pygpgtest'
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 349, in gnupg.GPG.list_keys
Failed example:
    assert print1 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.list_keys[9]>", line 1, in ?
        assert print1 in pubkeys.fingerprints
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 350, in gnupg.GPG.list_keys
Failed example:
    assert print2 in pubkeys.fingerprints
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.list_keys[10]>", line 1, in ?
        assert print2 in pubkeys.fingerprints
    AssertionError


======================================================================
FAIL: Doctest: gnupg.GPG.verify
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for gnupg.GPG.verify
  File "/usr/lib/python2.4/site-packages/gnupg.py", line 233, in verify

----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 239, in gnupg.GPG.verify
Failed example:
    assert key
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.verify[3]>", line 1, in ?
        assert key
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 243, in gnupg.GPG.verify
Failed example:
    assert sig
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.verify[7]>", line 1, in ?
        assert sig
    AssertionError
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/gnupg.py", line 245, in gnupg.GPG.verify
Failed example:
    assert verify
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.4/doctest.py", line 1243, in __run
        compileflags, 1) in test.globs
      File "<doctest gnupg.GPG.verify[9]>", line 1, in ?
        assert verify
    AssertionError


----------------------------------------------------------------------
Ran 14 tests in 5465.843s

FAILED (failures=5)


More information about the Gnupg-users mailing list