From f1f4e120f539d3264741104cd64c76e1813487c0 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 21 Jul 2017 17:43:00 +0100 Subject: [PATCH] =?UTF-8?q?[filesystem]=20exclude=20'=5F=5FMACOSX'=20metad?= =?UTF-8?q?ata=C2=A0dir=20contained=20in=20zip=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/ufoLib/filesystem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/ufoLib/filesystem.py b/Lib/ufoLib/filesystem.py index ab2b72340..34e626929 100644 --- a/Lib/ufoLib/filesystem.py +++ b/Lib/ufoLib/filesystem.py @@ -74,7 +74,11 @@ class FileSystem(object): raise UFOLibError("The fs module is required for reading and writing UFO ZIP.") path = ZipFS( path, write=True if mode == 'w' else False, encoding="utf8") - roots = path.listdir("") + roots = [ + p for p in path.listdir("") + # exclude macOS metadata contained in zip file + if path.isdir(p) and p != "__MACOSX" + ] if not roots: self._root = u"contents" path.makedir(self._root)