Skip to content

Build fails with python2 #191

@thekad

Description

@thekad

Was using sigal with python 2 and I was doing some imports in the config file, which was making the build break with the following stack trace:

Traceback (most recent call last):
  File "/home/familia/.virtualenvs/sigal/bin/sigal", line 11, in <module>
    sys.exit(main())
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/sigal/__init__.py", line 142, in build
    gal.build(force=force)
  File "/home/familia/.virtualenvs/sigal/lib/python2.7/site-packages/sigal/gallery.py", line 615, in build
    for res in self.pool.imap_unordered(worker, media_list):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 668, in next
    raise value
cPickle.PicklingError: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed

Switched to python 3 to discard issues and this time I got this message instead:

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.

Which is just what I needed. Looking at https://github.com/saimn/sigal/blob/master/sigal/gallery.py#L618 it looks to me as if the except block should also consider cPickle.PicklingError (for python 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions