New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with python2 #191

Closed
thekad opened this Issue Jan 17, 2016 · 1 comment

Comments

2 participants
@thekad
Contributor

thekad commented Jan 17, 2016

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)

saimn added a commit that referenced this issue Jan 18, 2016

@saimn

This comment has been minimized.

Owner

saimn commented Jan 18, 2016

Thanks for the report @thekad !

@saimn saimn closed this Jan 18, 2016

@saimn saimn added this to the 1.1.0 milestone Jan 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment