From 6ddf0d657f70eb03d17af2e63eb52d6ef33305be Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 29 Apr 2016 17:35:01 +0200 Subject: certprofile plugin: Use binary mode for file with binary data Part of the work for: https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Martin Basti Reviewed-By: Petr Spacek --- ipalib/plugins/certprofile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipalib/plugins/certprofile.py b/ipalib/plugins/certprofile.py index 6329d84c3..224d5cec8 100644 --- a/ipalib/plugins/certprofile.py +++ b/ipalib/plugins/certprofile.py @@ -224,7 +224,7 @@ class certprofile_show(LDAPRetrieve): result = super(certprofile_show, self).forward(*keys, **options) if 'out' in options and 'config' in result['result']: - with open(options['out'], 'w') as f: + with open(options['out'], 'wb') as f: f.write(result['result'].pop('config')) result['summary'] = ( _("Profile configuration stored in file '%(file)s'") -- cgit