python: Fix simple example.
authorJustus Winter <justus@gnupg.org>
Wed, 11 May 2016 11:51:40 +0000 (13:51 +0200)
committerJustus Winter <justus@gnupg.org>
Wed, 11 May 2016 11:51:40 +0000 (13:51 +0200)
* lang/python/examples/simple.py: Flush stdout, encode name as
UTF-8 before passing it to GPGME.

Signed-off-by: Justus Winter <justus@gnupg.org>
lang/python/examples/simple.py

index 5693d40..739291e 100755 (executable)
@@ -36,8 +36,9 @@ c.set_armor(1)
 # Set up the recipients.
 
 sys.stdout.write("Enter name of your recipient: ")
+sys.stdout.flush()
 name = sys.stdin.readline().strip()
-c.op_keylist_start(name, 0)
+c.op_keylist_start(name.encode(), 0)
 r = c.op_keylist_next()
 
 if r == None: