From d38540acd614bcaa489023401fc8db7c02cd3892 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Feb 08 2017 14:41:39 +0000 Subject: py3: DN: fix BytesWarning User repr() instead of str() for bytes, it has the same effect, but it is proper way how to print bytes https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Stanislav Laznicka --- diff --git a/ipapython/dn.py b/ipapython/dn.py index 2f7655d..4e8c22b 100644 --- a/ipapython/dn.py +++ b/ipapython/dn.py @@ -452,7 +452,7 @@ def _adjust_indices(start, end, length): def _normalize_ava_input(val): if six.PY3 and isinstance(val, bytes): - raise TypeError('expected str, got bytes: %s' % val) + raise TypeError('expected str, got bytes: %r' % val) elif not isinstance(val, six.string_types): val = val_encode(six.text_type(val)) elif six.PY2 and isinstance(val, unicode):