#5938 otptoken-add is not Python 3 clean
Closed: Fixed Opened by abbra.

When IPA client is using Python 3, there is no str.decode() method
anymore.

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

Patch is available: https://www.redhat.com/archives/freeipa-devel/2016-June/msg00155.html

master:

  • 29d669fec18c089619c199d66195ec3b73df7ee1 otptoken: support Python 3 for the qr code

ipa-4-3:

  • 94822209c4b6d4902188fc461578b819dfd2f7fc otptoken: support Python 3 for the qr code

Metadata Update from @abbra:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.3.2

Metadata