From d6dfcc1897238d60dcde474d5030ef12679ccac8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 29 Jul 2016 23:10:24 +0300 Subject: [PATCH] Open log with utf-8 encoding --- m_lib/net/ftp/ftpscan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m_lib/net/ftp/ftpscan.py b/m_lib/net/ftp/ftpscan.py index f23e7ac..ebff998 100755 --- a/m_lib/net/ftp/ftpscan.py +++ b/m_lib/net/ftp/ftpscan.py @@ -3,6 +3,7 @@ from __future__ import print_function +import codecs import ftplib from .ftpparse import ftpparse @@ -221,7 +222,7 @@ def test(ftp_server, func, passive=None, reconnect=False): print(stop_time - start_time) logfname = "%s.list" % ftp_server - log = open(logfname, 'w') + log = codecs.open(logfname, 'w', encoding='utf-8') for ftp_dir, files in tree: if ftp_dir == ftpscan_error_mark: -- 2.39.5