From: Oleg Broytman Date: Fri, 29 Jul 2016 20:10:24 +0000 (+0300) Subject: Open log with utf-8 encoding X-Git-Tag: 3.0.0^0 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=d6dfcc1897238d60dcde474d5030ef12679ccac8;p=m_lib.git Open log with utf-8 encoding --- 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: