From 391eb279640ea9250f5d16d44c4691a5b7d4efc1 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 13 Jan 2018 15:29:23 +0100 Subject: Open and write logs and config files in utf-8 --- poezio/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'poezio/config.py') diff --git a/poezio/config.py b/poezio/config.py index 7ac630b6..08920942 100644 --- a/poezio/config.py +++ b/poezio/config.py @@ -337,7 +337,8 @@ class Config(RawConfigParser): prefix, file = path.split(self.file_name) filename = path.join(prefix, '.%s.tmp' % file) fd = os.fdopen( - os.open(filename, os.O_WRONLY | os.O_CREAT, 0o600), 'w') + os.open(filename, os.O_WRONLY | os.O_CREAT, 0o600,), 'w', + encoding='utf-8') for line in lines: fd.write('%s\n' % line) fd.close() -- cgit v1.2.3