LDIFWriter.unparse() expects the scalar values of the attributes of the entries to be bytes as it applies a byte regular expression to check whether to base64-encode the values or not. Previously, we were passing the scalar attribute values as strings which was breaking the LDIFWriter.unparse() exectution. https://pagure.io/freeipa/issue/7131 Reviewed-By: Felipe Barreto <fbarreto@redhat.com>