]> git.phdru.name Git - m_lib.git/commitdiff
Open log with utf-8 encoding 3.0.0
authorOleg Broytman <phd@phdru.name>
Fri, 29 Jul 2016 20:10:24 +0000 (23:10 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 29 Jul 2016 20:10:24 +0000 (23:10 +0300)
m_lib/net/ftp/ftpscan.py

index f23e7ac39be179d692a8de0f079ef73acbaaa67d..ebff998f72a2c1c50ef0bd03bc537674a18618b4 100755 (executable)
@@ -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: