[Freeipa-devel] thin client regressions: otptoken

Jan Cholasta jcholast at redhat.com
Wed Jun 8 12:59:17 UTC 2016


On 7.6.2016 10:41, Alexander Bokovoy wrote:
> On Tue, 07 Jun 2016, Jan Cholasta wrote:
>> On 7.6.2016 10:17, Alexander Bokovoy wrote:
>>> ipa: ERROR: AttributeError: 'str' object has no attribute 'decode'
>>> Traceback (most recent call last):
>>> File "/usr/lib/python3.5/site-packages/ipalib/cli.py", line 1345, in run
>>>   sys.exit(api.Backend.cli.run(argv))
>>> File "/usr/lib/python3.5/site-packages/ipalib/cli.py", line 1110, in run
>>>   rv = cmd.output_for_cli(self.api.Backend.textui, result, *args,
>>> **options)
>>> File "/usr/lib/python3.5/site-packages/ipaclient/plugins/otptoken.py",
>>> line 103, in output_for_cli
>>>   qr = self._get_qrcode(output, uri, options['version'])
>>> File "/usr/lib/python3.5/site-packages/ipaclient/plugins/otptoken.py",
>>> line 61, in _get_qrcode
>>>   qr_code = qr_output.getvalue().decode(encoding)
>>> AttributeError: 'str' object has no attribute 'decode' ipa: ERROR: an
>>> internal error has occurred
>>
>> Looks rather like a py3 regression to me.
>>
> Fix attached, made a ticket https://fedorahosted.org/freeipa/ticket/5938

The check is incorrect actually - a proper fix would be to use encode 
instead of decode.

-- 
Jan Cholasta




More information about the Freeipa-devel mailing list