From: Daira Hopwood Date: Fri, 16 Oct 2015 02:25:45 +0000 (+0100) Subject: Decode names in the scanned remote. X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=bb4dd732f8314893da2a6a7953b9d025cf31fb7d;p=tahoe-lafs%2Ftahoe-lafs.git Decode names in the scanned remote. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index fbbaa3b2..25fd0a6d 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -541,14 +541,17 @@ class Downloader(QueueMixin, WriteFileMixin): self._log("_scan_remote nickname %r" % (nickname,)) d = dirnode.list() def scan_listing(listing_map): - for name in listing_map.keys(): - file_node, metadata = listing_map[name] - local_version = self._get_local_latest(name) + for encoded_relpath_u in listing_map.keys(): + relpath_u = magicpath.magic2path(encoded_relpath_u) + self._log("found %r" % (relpath_u,)) + + file_node, metadata = listing_map[encoded_relpath_u] + local_version = self._get_local_latest(relpath_u) remote_version = metadata.get('version', None) - self._log("%r has local version %r, remote version %r" % (name, local_version, remote_version)) + self._log("%r has local version %r, remote version %r" % (relpath_u, local_version, remote_version)) if local_version is None or remote_version is None or local_version < remote_version: - self._log("added to download queue\n") - self._append_to_batch(name, file_node, metadata) + self._log("%r added to download queue" % (relpath_u,)) + self._append_to_batch(relpath_u, file_node, metadata) d.addCallback(scan_listing) return d