Hi,

On 8.3.2016 16:21, Martin Babinsky wrote:
https://fedorahosted.org/freeipa/ticket/5700


1) Instead of checking for utf-8 in particular, I would prefer a more robust approach:

try:
    qr = qrcode.QRCode()
    qr.add_data('test')
    qr.make()
    qr.print_ascii(tty=True)
except UnicodeError:
    # it is not printable
else:
    # it is printable


2) There is no os.isatty() check to see if stdout is actually a tty.


Honza

--
Jan Cholasta

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to