From 58926646ef62948fbfef60e58caa0d598717fbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Avard=20Gulldahl?= Date: Fri, 1 Jul 2016 21:49:16 +0200 Subject: [PATCH] Another #115 unicode/bytestring fix --- src/jottalib/jottacloud.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jottalib/jottacloud.py b/src/jottalib/jottacloud.py index e05a2c0..b008345 100644 --- a/src/jottalib/jottacloud.py +++ b/src/jottalib/jottacloud.py @@ -110,7 +110,8 @@ def excluded(unicodepath, fname): log.debug("%r excluded by pattern %r", fpath, p.pattern) return True return False - for dirpath, dirnames, filenames in os.walk(localtopdir, followlinks=followlinks): + bytestring_localtopdir = _encode_filename_to_filesystem(localtopdir) + for dirpath, dirnames, filenames in os.walk(bytestring_localtopdir, followlinks=followlinks): # to keep things explicit, and avoid encoding/decoding issues, # keep a bytestring AND a unicode variant of dirpath dirpath = _encode_filename_to_filesystem(dirpath)