From c7f69e09ca341606feda30ac663c7f059931ba6f Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 13 Jun 2018 19:26:00 -0300 Subject: [PATCH] =?UTF-8?q?Pula=20diret=C3=B3rios=20corrompidos=20ao=20exp?= =?UTF-8?q?ortar=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index d6af2c535..7494dca17 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -146,8 +146,16 @@ def get_conteudo_dtml_method(doc): def enumerate_by_key_list(folder, key_list, type_key): for entry in folder.get(key_list, []): id, meta_type = entry['id'], entry[type_key] - obj = br(folder.get(id, None)) - yield id, obj, meta_type + try: + obj = br(folder.get(id, None)) + except POSKeyError: + print('#' * 80) + print('#' * 80) + print('ATENÇÃO: DIRETÓRIO corrompido: {}'.format(id)) + print('#' * 80) + print('#' * 80) + else: + yield id, obj, meta_type enumerate_folder = partial(enumerate_by_key_list,