Use bytes for 'D' response parameters in pinentry.py.
authorW. Trevor King <wking@tremily.us>
Sat, 21 Apr 2012 17:03:10 +0000 (13:03 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 21 Apr 2012 17:11:03 +0000 (13:11 -0400)
bin/pinentry.py

index f78bafc5ccfd655066ccb959377363ee14053d19..9d0e7251e52a4a47ff96099833b16e7378737c1b 100755 (executable)
@@ -216,9 +216,9 @@ class PinEntry (_server.AssuanServer):
 
     def _handle_GETINFO(self, arg):
         if arg == 'pid':
-            yield _common.Response('D', str(_os.getpid()))
+            yield _common.Response('D', str(_os.getpid()).encode('ascii'))
         elif arg == 'version':
-            yield _common.Response('D', __version__)
+            yield _common.Response('D', __version__.encode('ascii'))
         else:
             raise _error.AssuanError(message='Invalid parameter')
         yield _common.Response('OK')
@@ -283,7 +283,7 @@ class PinEntry (_server.AssuanServer):
             pin = self._prompt(self.strings['prompt'], add_colon=False)
         finally:
             self._disconnect()
-        yield _common.Response('D', pin)
+        yield _common.Response('D', pin.encode('ascii'))
         yield _common.Response('OK')
 
     def _handle_CONFIRM(self, arg):