[Grok-dev] zope.app.file/zope.file buildout error

Danilo G B danilogbotelho at yahoo.com
Wed May 23 12:39:39 UTC 2012

Mauro, this was a very boring situation I had to handle some time ago.

After a long time I came up with this solution: include the snippet below before <grok:grok package="." /> in your configure.zcml. Soon you will learn that this way of handling files is not the best. I'm temporarily using an ancient version of dolmen.file (when it still depended on z3c.form). When the need comes, I'll probably have to write a package of my own since it seems people out there don't share this issue nor do they regarding a good solution.

<!-- zope.file requirements -->
  <include package="zope.browsermenu" file="meta.zcml" />
  <include package="zope.browsermenu" />
  <browser:menu id="zmi_views" title="ZMI Views" />
  <browser:menu id="zmi_actions" title="ZMI Actions" />


Message: 1
Date: Tue, 22 May 2012 17:48:54 +0200
From: Mauro Boschi <me at monadic.org>
To: grok-dev at zope.org
Subject: [Grok-dev] zope.app.file/zope.file buildout error
Message-ID: <CEA836D2-D16C-4185-B1D9-DD649514BCCE at monadic.org>
Content-Type: text/plain; charset="us-ascii"

I've tried to run Music Tutorial but it doesn't work in song.py section ( http://grok.zope.org/documentation/tutorial/musical-performance-organizer-part-1 ). So I've tried zope.file how-to: http://grok.zope.org/documentation/how-to/uploading-file but it doesn't work too! :(

with a new grokproject test

I've added in buildout.cfg:
    recipe = collective.recipe.template
    input = etc/zope.conf.in
    output = ${buildout:parts-directory}/etc/zope.conf
    filestorage = ${buildout:directory}/var/filestorage
    blobstorage = ${buildout:directory}/var/blobstorage
    devmode = on
    extra =

#I've added the devmode line to resolve another error.

Then I've added in setup.py:
                        # Add extra requirements here

bin/buildout run without errors but when grok startup: 

bin/paster serve --reload parts/etc/debug.ini

It raises this error:
ConfigurationError: ('Invalid value for', 'menu', "ImportError: Couldn't import zmi_views, No module named zmi_views")
Complete output there: http://pastebin.com/4ttSuCYp

I've tried with zope.app.file part from the same how-to but it raises a different error:
File "/usr/lib/python2.7/email/mime/image.py", line 9, in <module>
    import imghdr
RuntimeError: sys.path must be a list of directory names
Complete output there: http://pastebin.com/ysH1VRA7

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120522/f4148505/attachment-0001.sig>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120523/338492f9/attachment.html>

More information about the Grok-dev mailing list