From 4b53ea77009ddf776fbb45ad66eeae7d59408657 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 30 Oct 2011 21:32:38 +0100 Subject: [PATCH] [entropy.security] use codecs.open() --- lib/entropy/security.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/entropy/security.py b/lib/entropy/security.py index b675e7728..ac4ec3c2e 100644 --- a/lib/entropy/security.py +++ b/lib/entropy/security.py @@ -20,6 +20,7 @@ import subprocess import datetime import tempfile import time +import codecs from entropy.exceptions import EntropyException from entropy.const import etpConst, etpUi, const_setup_perms, \ @@ -1417,7 +1418,8 @@ class Repository: # write back, safely self.__key_list_cache = None tmp_path = self.__keymap_file+".entropy.tmp" - with open(tmp_path, "w") as key_f: + enc = etpConst['conf_encoding'] + with codecs.open(tmp_path, "w", encoding=enc) as key_f: for key, fp in new_keymap.items(): key_f.write("%s %s\n" % (key, fp,)) key_f.flush()