example: encrypt file
authorBen McGinnes <ben@adversary.org>
Mon, 19 Mar 2018 22:39:48 +0000 (09:39 +1100)
committerBen McGinnes <ben@adversary.org>
Mon, 19 Mar 2018 22:39:48 +0000 (09:39 +1100)
* Fixed typo in second encryption call.

lang/python/examples/howto/encrypt-file.py

index 718c715..8aee52a 100755 (executable)
@@ -58,7 +58,7 @@ with gpg.Context(armor=True) as ca:
         fa.write(ciphertext)
 
 with gpg.Context() as cg:
-    ciphertext, result, sign_result = ca.encrypt(text, recipients=rkey,
+    ciphertext, result, sign_result = cg.encrypt(text, recipients=rkey,
                                                  sign=False)
     with open("{0}.gpg".format(filename), "wb") as fg:
         fg.write(ciphertext)