diff -Nru python-gnupg-0.4.6/debian/changelog python-gnupg-0.4.7/debian/changelog --- python-gnupg-0.4.6/debian/changelog 2020-09-07 21:03:43.000000000 +0000 +++ python-gnupg-0.4.7/debian/changelog 2021-07-03 17:00:28.000000000 +0000 @@ -1,3 +1,10 @@ +python-gnupg (0.4.7-0ubuntu1~18.04.sav0) bionic; urgency=medium + + * New upstream release + * d/patches/: Rebase for new source + + -- Rob Savoury Sat, 03 Jul 2021 10:00:28 -0700 + python-gnupg (0.4.6-1~18.04.sav0) bionic; urgency=medium * Backport to Bionic diff -Nru python-gnupg-0.4.6/debian/patches/make-tests-more-verbose.patch python-gnupg-0.4.7/debian/patches/make-tests-more-verbose.patch --- python-gnupg-0.4.6/debian/patches/make-tests-more-verbose.patch 2020-04-22 19:27:35.000000000 +0000 +++ python-gnupg-0.4.7/debian/patches/make-tests-more-verbose.patch 2021-07-03 17:00:28.000000000 +0000 @@ -1,15 +1,16 @@ From: Matthias Klose Subject: Make tests more verbose +Last-Update: 2021-07-03 --- --- a/test_gnupg.py +++ b/test_gnupg.py -@@ -1062,7 +1062,7 @@ def main(): +@@ -1176,7 +1176,7 @@ def main(): init_logging() logger.debug('Python version: %s', sys.version.replace('\n', ' ')) tests = suite() - results = unittest.TextTestRunner(verbosity=1).run(tests) + results = unittest.TextTestRunner(verbosity=2).run(tests) - return not results.wasSuccessful() - - + failed = not results.wasSuccessful() + if failed and 'TOXENV' in os.environ and os.name != 'posix': + os.system('type test_gnupg.log') diff -Nru python-gnupg-0.4.6/gnupg.py python-gnupg-0.4.7/gnupg.py --- python-gnupg-0.4.6/gnupg.py 2020-04-17 08:35:35.000000000 +0000 +++ python-gnupg-0.4.7/gnupg.py 2021-03-11 07:01:14.000000000 +0000 @@ -27,14 +27,14 @@ and so does not work on Windows). Renamed to gnupg.py to avoid confusion with the previous versions. -Modifications Copyright (C) 2008-2019 Vinay Sajip. All rights reserved. +Modifications Copyright (C) 2008-2021 Vinay Sajip. All rights reserved. A unittest harness (test_gnupg.py) has also been added. """ -__version__ = "0.4.6" +__version__ = "0.4.7" __author__ = "Vinay Sajip" -__date__ = "$17-Apr-2020 09:35:35$" +__date__ = "$11-Mar-2021 07:01:14$" try: from io import StringIO @@ -1166,7 +1166,7 @@ # KEY MANAGEMENT # - def import_keys(self, key_data, extra_args=None): + def import_keys(self, key_data, extra_args=None, passphrase=None): """ Import the key_data into our keyring. """ @@ -1176,7 +1176,7 @@ args = ['--import'] if extra_args: args.extend(extra_args) - self._handle_io(args, data, result, binary=True) + self._handle_io(args, data, result, passphrase=passphrase, binary=True) logger.debug('import_keys result: %r', result.__dict__) data.close() return result @@ -1307,7 +1307,7 @@ binary=True) finally: f.close() - logger.debug('export_keys result: %r', result.data) + logger.debug('export_keys result[:100]: %r', result.data[:100]) # Issue #49: Return bytes if armor not specified, else text result = result.data if armor: @@ -1462,6 +1462,7 @@ Generate --gen-key input per gpg doc/DETAILS """ parms = {} + no_protection = kwargs.pop('no_protection', False) for key, val in list(kwargs.items()): key = key.replace('_','-').title() if str(val).strip(): # skip empty strings @@ -1478,6 +1479,8 @@ out = "Key-Type: %s\n" % parms.pop('Key-Type') for key, val in list(parms.items()): out += "%s: %s\n" % (key, val) + if no_protection: + out += '%no-protection\n' out += "%commit\n" return out @@ -1542,7 +1545,7 @@ args.extend(extra_args) result = self.result_map['crypt'](self) self._handle_io(args, file, result, passphrase=passphrase, binary=True) - logger.debug('encrypt result: %r', result.data) + logger.debug('encrypt result[:100]: %r', result.data[:100]) return result def encrypt(self, data, recipients, **kwargs): @@ -1612,7 +1615,7 @@ args.extend(extra_args) result = self.result_map['crypt'](self) self._handle_io(args, file, result, passphrase, binary=True) - logger.debug('decrypt result: %r', result.data) + logger.debug('decrypt result[:100]: %r', result.data[:100]) return result def trust_keys(self, fingerprints, trustlevel): diff -Nru python-gnupg-0.4.6/PKG-INFO python-gnupg-0.4.7/PKG-INFO --- python-gnupg-0.4.6/PKG-INFO 2020-04-17 11:30:43.000000000 +0000 +++ python-gnupg-0.4.7/PKG-INFO 2021-03-11 08:23:20.000000000 +0000 @@ -1,15 +1,26 @@ Metadata-Version: 1.2 Name: python-gnupg -Version: 0.4.6 +Version: 0.4.7 Summary: A wrapper for the Gnu Privacy Guard (GPG or GnuPG) Home-page: https://docs.red-dove.com/python-gnupg/ Author: Vinay Sajip -Author-email: vinay_sajip@red-dove.com +Author-email: vinay_sajip@yahoo.co.uk Maintainer: Vinay Sajip -Maintainer-email: vinay_sajip@red-dove.com -License: Copyright (C) 2008-2019 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license. -Download-URL: https://pypi.io/packages/source/p/python-gnupg/python-gnupg-0.4.6.tar.gz +Maintainer-email: vinay_sajip@yahoo.co.uk +License: Copyright (C) 2008-2021 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license. +Download-URL: https://pypi.io/packages/source/p/python-gnupg/python-gnupg-0.4.7.tar.gz Description: This module allows easy access to GnuPG's key management, encryption and signature functionality from Python programs. It is intended for use with Python 2.4 or greater. + + Releases are normally signed using a GnuPG key with the user id vinay_sajip@yahoo.co.uk and the following fingerprint: + + CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 + + As PyPI no longer shows signatures, you should be able to download release archives and signatures from + + https://bitbucket.org/vinay.sajip/python-gnupg/downloads/ + + The archives should be the same as those uploaded to PyPI. + Platform: No particular restrictions Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers @@ -21,5 +32,6 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -Nru python-gnupg-0.4.6/python_gnupg.egg-info/PKG-INFO python-gnupg-0.4.7/python_gnupg.egg-info/PKG-INFO --- python-gnupg-0.4.6/python_gnupg.egg-info/PKG-INFO 2020-04-17 11:30:43.000000000 +0000 +++ python-gnupg-0.4.7/python_gnupg.egg-info/PKG-INFO 2021-03-11 08:23:20.000000000 +0000 @@ -1,15 +1,26 @@ Metadata-Version: 1.2 Name: python-gnupg -Version: 0.4.6 +Version: 0.4.7 Summary: A wrapper for the Gnu Privacy Guard (GPG or GnuPG) Home-page: https://docs.red-dove.com/python-gnupg/ Author: Vinay Sajip -Author-email: vinay_sajip@red-dove.com +Author-email: vinay_sajip@yahoo.co.uk Maintainer: Vinay Sajip -Maintainer-email: vinay_sajip@red-dove.com -License: Copyright (C) 2008-2019 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license. -Download-URL: https://pypi.io/packages/source/p/python-gnupg/python-gnupg-0.4.6.tar.gz +Maintainer-email: vinay_sajip@yahoo.co.uk +License: Copyright (C) 2008-2021 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license. +Download-URL: https://pypi.io/packages/source/p/python-gnupg/python-gnupg-0.4.7.tar.gz Description: This module allows easy access to GnuPG's key management, encryption and signature functionality from Python programs. It is intended for use with Python 2.4 or greater. + + Releases are normally signed using a GnuPG key with the user id vinay_sajip@yahoo.co.uk and the following fingerprint: + + CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 + + As PyPI no longer shows signatures, you should be able to download release archives and signatures from + + https://bitbucket.org/vinay.sajip/python-gnupg/downloads/ + + The archives should be the same as those uploaded to PyPI. + Platform: No particular restrictions Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers @@ -21,5 +32,6 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -Nru python-gnupg-0.4.6/README.rst python-gnupg-0.4.7/README.rst --- python-gnupg-0.4.6/README.rst 2020-04-17 08:33:32.000000000 +0000 +++ python-gnupg-0.4.7/README.rst 2021-03-11 06:59:24.000000000 +0000 @@ -64,11 +64,25 @@ .. note:: GCnn refers to an issue nn on Google Code. -0.4.7 (future) +0.4.8 (future) -------------- Released: Not yet. +0.4.7 +----- + +Released: 2021-03-11 + +* Fixed #129, #141: Added support for no passphrase during key generation. + +* Fixed #143: Improved permission-denied test. Thanks to Elliot Cameron for the patch. + +* Fixed #144: Updated logging to only show partial results. + +* Fixed #146: Allowed a passphrase to be passed to import_keys(). Thanks to Chris de + Graaf for the patch. + 0.4.6 ----- diff -Nru python-gnupg-0.4.6/setup.py python-gnupg-0.4.7/setup.py --- python-gnupg-0.4.6/setup.py 2020-04-17 11:29:40.000000000 +0000 +++ python-gnupg-0.4.7/setup.py 2021-01-12 21:26:32.000000000 +0000 @@ -4,15 +4,28 @@ setup(name = "python-gnupg", description="A wrapper for the Gnu Privacy Guard (GPG or GnuPG)", - long_description = "This module allows easy access to GnuPG's key \ + long_description = """This module allows easy access to GnuPG's key \ management, encryption and signature functionality from Python programs. \ -It is intended for use with Python 2.4 or greater.", - license="""Copyright (C) 2008-2019 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license.""", +It is intended for use with Python 2.4 or greater. + +Releases are normally signed using a GnuPG key with the user id \ +vinay_sajip@yahoo.co.uk and the following fingerprint: + +CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 + +As PyPI no longer shows signatures, you should be able to download release archives \ +and signatures from + +https://bitbucket.org/vinay.sajip/python-gnupg/downloads/ + +The archives should be the same as those uploaded to PyPI. +""", + license="""Copyright (C) 2008-2021 by Vinay Sajip. All Rights Reserved. See LICENSE.txt for license.""", version=version, author="Vinay Sajip", - author_email="vinay_sajip@red-dove.com", + author_email="vinay_sajip@yahoo.co.uk", maintainer="Vinay Sajip", - maintainer_email="vinay_sajip@red-dove.com", + maintainer_email="vinay_sajip@yahoo.co.uk", url="https://docs.red-dove.com/python-gnupg/", py_modules=["gnupg"], platforms="No particular restrictions", @@ -28,6 +41,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules" ] diff -Nru python-gnupg-0.4.6/test_gnupg.py python-gnupg-0.4.7/test_gnupg.py --- python-gnupg-0.4.6/test_gnupg.py 2020-04-17 08:36:09.000000000 +0000 +++ python-gnupg-0.4.7/test_gnupg.py 2021-03-11 07:01:41.000000000 +0000 @@ -2,7 +2,7 @@ """ A test harness for gnupg.py. -Copyright (C) 2008-2020 Vinay Sajip. All rights reserved. +Copyright (C) 2008-2021 Vinay Sajip. All rights reserved. """ import doctest import io @@ -30,7 +30,7 @@ import gnupg __author__ = "Vinay Sajip" -__date__ = "$17-Apr-2020 09:36:09$" +__date__ = "$11-Mar-2020 07:01:41$" ALL_TESTS = True @@ -922,9 +922,10 @@ "Test encrypting to invalid output files" encfno, encfname = tempfile.mkstemp() os.close(encfno) + os.chmod(encfname, 0o400) cases = ( ('/dev/null/foo', 'encrypt: not a directory'), - ('/etc/foo', 'encrypt: permission denied'), + (encfname, 'encrypt: permission denied'), ) key = self.generate_key("Barbara", "Brown", "beta.com") barbara = key.fingerprint @@ -948,20 +949,27 @@ self.gpg.error_map = messages - cases = ( - ('/dev/null/foo', 'encrypt: Not a directory'), - ('/etc/foo', 'encrypt: Permission denied'), - ) - - for badout, message in cases: - stream = gnupg._make_binary_stream(data, self.gpg.encoding) - edata = self.gpg.encrypt_file(stream, - barbara, armor=False, output=badout) - # on GnuPG 1.4, you sometimes don't get any FAILURE messages, in - # which case status will not be set - if edata.status: - self.assertEqual(edata.status, message) - + encfno, encfname = tempfile.mkstemp() + os.close(encfno) + os.chmod(encfname, 0o400) + + try: + cases = ( + ('/dev/null/foo', 'encrypt: Not a directory'), + (encfname, 'encrypt: Permission denied'), + ) + + for badout, message in cases: + stream = gnupg._make_binary_stream(data, self.gpg.encoding) + edata = self.gpg.encrypt_file(stream, + barbara, armor=False, output=badout) + # on GnuPG 1.4, you sometimes don't get any FAILURE messages, in + # which case status will not be set + if edata.status: + self.assertEqual(edata.status, message) + finally: + os.chmod(encfname, 0o700) + os.remove(encfname) def test_filenames_with_spaces(self): # See Issue #16 "Test that filenames with spaces are correctly handled" @@ -1169,7 +1177,10 @@ logger.debug('Python version: %s', sys.version.replace('\n', ' ')) tests = suite() results = unittest.TextTestRunner(verbosity=1).run(tests) - return not results.wasSuccessful() + failed = not results.wasSuccessful() + if failed and 'TOXENV' in os.environ and os.name != 'posix': + os.system('type test_gnupg.log') + return failed if __name__ == "__main__":