From: W. Trevor King Date: Sat, 21 Apr 2012 17:03:10 +0000 (-0400) Subject: Use bytes for 'D' response parameters in pinentry.py. X-Git-Tag: v0.2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d1c160d5df1220d76ebc36118f4d898c34cfc969;p=pyassuan.git Use bytes for 'D' response parameters in pinentry.py. --- diff --git a/bin/pinentry.py b/bin/pinentry.py index f78bafc..9d0e725 100755 --- a/bin/pinentry.py +++ b/bin/pinentry.py @@ -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):