Merge pull request #1 from kolosovski/cyrillic_filenames

Fixed exception occurred when filenames contain russian letters
master
Роман 2016-11-17 13:40:31 +04:00 committed by GitHub
commit 1733e20b0e
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ def encode_msg(msg):
def localize_path(path): def localize_path(path):
if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding']) if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding'])
if not sys.platform.startswith('win'): if not sys.platform.startswith('win'):
path = path.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') path = path.encode((sys.getfilesystemencoding() not in ('ascii', 'ANSI_X3.4-1968')) and sys.getfilesystemencoding() or 'utf-8')
return path return path
def can_bind(host, port): def can_bind(host, port):