Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Vinay Sajip Newsgroups: comp.lang.python.announce Subject: ANN: A new version (0.4.1) of python-gnupg has been released. Date: Mon, 10 Jul 2017 21:40:56 +0000 (UTC) Lines: 117 Approved: python-announce-list@python.org Message-ID: References: <1241259385.3956741.1499722856981.ref@mail.yahoo.com> <1241259385.3956741.1499722856981@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de O+D6oy9BOOmmZME6zItB9g3sA9b8lthyUmhxCBnDXk4A== Return-Path: X-Original-To: python-announce-list@python.org Delivered-To: python-announce-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'skip:[ 20': 0.04; 'binary': 0.05; 'skip:\\ 20': 0.05; 'url:bitbucket': 0.05; '(especially': 0.07; 'defaults': 0.07; 'keys,': 0.07; 'subject:ANN': 0.07; 'unittest': 0.07; 'python': 0.09; 'chunk': 0.09; 'chunks': 0.09; 'derived': 0.09; 'gpg': 0.09; 'key)': 0.09; 'logic': 0.09; 'none.': 0.09; 'patch.': 0.09; 'patches': 0.09; 'pgp': 0.09; 'received:ir2.yahoo.com': 0.09; 'received:mail.ir2.yahoo.com': 0.09; 'release,': 0.09; 'subject:version': 0.09; 'trees': 0.09; 'url:issues': 0.09; 'bug': 0.10; 'subject:python': 0.13; 'python.': 0.14; 'steve': 0.15; '>>>': 0.15; '(code': 0.16; '-----end': 0.16; '[3],': 0.16; '[5]': 0.16; 'attribute,': 0.16; 'encryption': 0.16; 'executable.': 0.16; 'extra_args': 0.16; 'fingerprint:': 0.16; 'gnupg': 0.16; 'key:': 0.16; 'released.': 0.16; 'stream.': 0.16; 'subprocess': 0.16; 'v1.4.9': 0.16; 'argument': 0.18; 'module,': 0.18; 'skip': 0.18; 'skip:g 40': 0.18; '>>>': 0.19; 'to:2**1': 0.21; 'versions': 0.22; 'exceptions': 0.22; "skip:' 40": 0.22; 'daniel': 0.24; 'url:io': 0.24; 'module': 0.24; 'cheers': 0.24; 'skip:= 10': 0.24; 'signed': 0.25; 'import': 0.26; "skip:' 10": 0.26; 'earlier': 0.27; 'raise': 0.27; 'e.g.': 0.27; '[2]': 0.28; 'ignored.': 0.28; "isn't": 0.28; 'always,': 0.29; 'arguments': 0.29; 'behaviour': 0.29; 'callable': 0.29; 'encouraged': 0.29; 'optional.': 0.29; 'parameter': 0.29; 'wraps': 0.29; 'points': 0.29; 'code': 0.30; 'expected': 0.30; 'included': 0.30; 'from:addr:yahoo.co.uk': 0.31; 'url:python': 0.31; 'print': 0.32; '[1]': 0.33; 'handling': 0.33; 'separate': 0.33; 'source': 0.33; 'list': 0.33; 'gnu': 0.33; 'gross': 0.33; 'instances': 0.33; 'maintained': 0.33; 'brief': 0.33; 'url:en': 0.34; 'allows': 0.34; 'release': 0.34; 'version': 0.35; 'being': 0.35; 'data,': 0.35; 'newer': 0.35; 'class': 0.36; 'subject:: ': 0.36; 'file': 0.36; 'skip:& 10': 0.36; 'should': 0.36; 'url:org': 0.36; 'to:addr :python-list': 0.36; 'keyword': 0.36; 'project': 0.37; 'closing': 0.37; 'skip:p 20': 0.37; 'thanks': 0.37; 'mailing': 0.38; 'skip:- 10': 0.38; 'subject:-': 0.38; '...': 0.39; 'feedback': 0.39; 'data': 0.39; 'proto:https': 0.39; 'whatever': 0.39; 'received:io': 0.39; 'received:psf.io': 0.39; 'to:addr:python.org': 0.39; 'received:ams1.psf.io': 0.40; 'received:mail1.ams1.psf.io': 0.40; 'your': 0.61; 'red': 0.61; 'digital': 0.61; 'manage': 0.61; 'more': 0.62; 'programs': 0.62; 'received:77.238': 0.62; 'encrypted': 0.66; 'skip:\xc2 10': 0.67; 'privacy': 0.67; '8bit%:27': 0.72; '8bit%:31': 0.72; 'to:addr :python-announce-list': 0.72; 'url:4': 0.73; 'improved': 0.76; '2.1.': 0.84; 'received:gate.mail.ne1.yahoo.com': 0.84; 'received:sonic.gate.mail.ne1.yahoo.com': 0.84; 'upgrade.': 0.84; 'user)': 0.84; 'verified.': 0.93; 'url:nbsp': 0.95; 'enhancement': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1499724689; bh=kQuDBQaN1rDp8/JwRcUKDbZuc/bJbyc239GjjAptk48=; h=Date:From:To:Subject:References:From:Subject; b=YGBufZ6V4dasBkjzR3gJIMsCjfjMKhG2Y/M6FLzpJp57rK7iBHtGW1agTSbL8ZfMRgjrRFpd1Ot9MLkSo3KCRuv+Eyq3UcixmL/DebKBf5IWMbJ8Lj+nhm9JkdUWBfDb32AdoAVIC0vzFJExPe5R0QG+dSLpUL1ZM6Jr6FPyul/hzbKZYL8opTsWL8NzCyY7ILf6znxv8oo+fI0manoe1rnd5i9ZMNZbhAATnfRi8JsfjvNlDACOauHGoqFMTdVw4ly3DJKjRMkK96eiahWqlfCuPrSC76g89MqLR/TipUEetjIfmdft2CcInsCnHIDFFmpnfiet6N9ZArZQxCiBxg== X-YMail-OSG: JEBsKqgVM1nRxkyS8lfAeyGyS.72AOSSFWLxwPmSNogpuQAbxjUgydh_TCuDT.J W83D6Woo6ae5_Nu6C31U364EjjtM_oAa2ppPwMRxFZY1l3nEI5nrvVVz8u4PzO7mF7RAQtQAX3cR UAD7zrTO4iqkBW1pg8hdX_yRrUiahhFPEdfhHbyNcC008L.GKuw7L4GJaBo5ZiGmv4aL5h.mLTGP tmCZ6Zx3CJQqQwBdINa9hIN0VIoUQ9QG3sdd_LaM8tOWHRkAFndBjXCIB00LOw7Z2fdKijW8aCNN p89WeoMPtkIXECWavby_lpkYmkAyKJX_hc9wTjV2Yu.MWd0S3wmWvVNGDJQ5_UCSYRebjrhg23VQ MAuU8bTacriU9ALTaV74pK3NipyOQR_qOCzZIqH.f3jxMPF2mSote7vMkODDH0roisgg.ByWWncV ConeNx0CV6BJrzlmwK0XCe_mmEr6XX9Lzr0fr5H4XiSYztvFYvF6iDsY8DPhmp09nJudgNcpuPb6 fcou2.tnPpFFVjtLa6SYbhufyTxjg0aWP X-Mailer: WebService/1.1.10014 YMailNorrin Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 X-Mailman-Approved-At: Tue, 11 Jul 2017 03:33:25 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.24 X-BeenThere: python-announce-list@python.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Announcement-only list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1241259385.3956741.1499722856981@mail.yahoo.com> X-Mailman-Original-References: <1241259385.3956741.1499722856981.ref@mail.yahoo.com> Xref: csiph.com comp.lang.python.announce:2567 A new version of the Python module which wraps GnuPG has been released. What Changed? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This is an enhancement and bug-fix release, and all users are encouraged to= upgrade. See the project website [1] for more information. Brief summary: * Updated message handling logic to no longer raise exceptions when a messa= ge isn't =C2=A0=C2=A0recognised. Thanks to Daniel Kahn Gillmor for the patch. * Always use always use --fixed-list-mode, --batch and --with-colons. Thank= s to Daniel =C2=A0=C2=A0Kahn Gillmor for the patch. * Improved scan_keys() handling on GnuPG >=3D 2.1. Thanks to Daniel Kahn Gi= llmor for the =C2=A0=C2=A0patch. * Improved test behaviour with GnuPG >=3D 2.1. Failures when deleting test = directory trees =C2=A0=C2=A0are now ignored. Thanks to Daniel Kahn Gillmor for the patch. * Added close_file keyword argument to verify_file to allow the file closin= g to be made =C2=A0=C2=A0optional. Current behaviour is maintained - close_file=3DFalse = can be passed to skip =C2=A0=C2=A0closing the file being verified. * Added the extra_args keyword parameter to allow custom arguments to be pa= ssed to the =C2=A0=C2=A0gpg executable. * Instances of the GPG class now have an additional on_data attribute, whic= h defaults to =C2=A0=C2=A0None. It can be set to a callable which will be called with a s= ingle argument - a binary =C2=A0=C2=A0chunk of data received from the gpg executable. The callable ca= n do whatever it likes =C2=A0=C2=A0with the chunks passed to it - e.g. write them to a separate st= ream. The callable should =C2=A0=C2=A0not raise any exceptions (unless it wants the current operation= to fail). This release [2] has been signed with my code signing key: Vinay Sajip (CODE SIGNING KEY) Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 What Does It Do? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The gnupg module allows Python programs to make use of the functionality provided by the Gnu Privacy Guard (abbreviated GPG or GnuPG). Using this module, Python programs can encrypt and decrypt data, digitally sign documents and verify digital signatures, manage (generate, list and delete) encryption keys, using proven Public Key Infrastructure (PKI) encryption technology based on OpenPGP. This module is expected to be used with Python versions >=3D 2.4, as it makes use of the subprocess module which appeared in that version of Python. This module is a newer version derived from earlier work by Andrew Kuchling, Richard Jones and Steve Traugott. A test suite using unittest is included with the source distribution. Simple usage: >>> import gnupg >>> gpg =3D gnupg.GPG(gnupghome=3D'/path/to/keyring/directory') >>> gpg.list_keys() [{ ... 'fingerprint': 'F819EE7705497D73E3CCEE65197D5DAC68F1AAB2', 'keyid': '197D5DAC68F1AAB2', 'length': '1024', 'type': 'pub', 'uids': ['', 'Gary Gross (A test user) ']}, { ... 'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A', 'keyid': '0C5FEFA7A921FC4A', 'length': '1024', ... 'uids': ['', 'Danny Davis (A test user) ']}] >>> encrypted =3D gpg.encrypt("Hello, world!", ['0C5FEFA7A921FC4A']) >>> str(encrypted) '-----BEGIN PGP MESSAGE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n \nhQIOA/6NHMDTXUwcEAf . -----END PGP MESSAGE-----\n' >>> decrypted =3D gpg.decrypt(str(encrypted), passphrase=3D'secret') >>> str(decrypted) 'Hello, world!' >>> signed =3D gpg.sign("Goodbye, world!", passphrase=3D'secret') >>> verified =3D gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' As always, your feedback is most welcome (especially bug reports [3], patches and suggestions for improvement, or any other points via the mailing list/discussion group [4]). Please refer to the documentation [5] for more information. Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. [1] https://bitbucket.org/vinay.sajip/python-gnupg [2] https://pypi.python.org/pypi/python-gnupg/0.4.1 [3] https://bitbucket.org/vinay.sajip/python-gnupg/issues [4] https://groups.google.com/forum/#!forum/python-gnupg [5] https://gnupg.readthedocs.io/en/latest/=C2=A0