From 15091deeb55a4dc3da3ccbc6703c2c8de27c67e3 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Thu, 4 Sep 2014 22:33:19 +0200 Subject: [PATCH] Catch cPickle error and add a message about serialization error with the settings file. --- sigal/gallery.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sigal/gallery.py b/sigal/gallery.py index 948015d..136b07f 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -23,6 +23,7 @@ from __future__ import absolute_import, print_function +import cPickle import fnmatch import logging import multiprocessing @@ -540,6 +541,13 @@ class Gallery(object): except KeyboardInterrupt: self.pool.terminate() sys.exit('Interrupted') + except cPickle.PicklingError: + self.logger.critical( + "Failed to process files with the multiprocessing feature." + " This can be caused by some module import or object " + "defined in the settings file, which can't be serialized.", + exc_info=True) + sys.exit('Abort') print('')