Wierd Thing: Grok Groping All Modules?

View: New views
19 Messages — Rating Filter:   Alert me  

Wierd Thing: Grok Groping All Modules?

by Jeff Rush :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I'm just starting to check out Grok and when I do my first:

  $ bin/python bin/zopectl fg

it gives me a traceback that I've chased down to the z3c.autoinclude package
trying to import everything in my site-packages.  That is a no-no.  I added
print stmts and I see:

$ bin/python bin/zopectl fg

/home/jeff/Projects/grokwork/parts/app/runzope -C

/home/jeff/Projects/grokwork/parts/zopectl/zope.conf

JRR: include_candidates are ['configure.zcml', 'meta.zcml']

JRR: dotted_name is 'bb'

JRR: dotted_name is 'PIL'

JRR: dotted_name is 'gsf'

JRR: dotted_name is 'svn'

JRR: dotted_name is 'atom'

JRR: dotted_name is 'dbus'

JRR: dotted_name is 'lxml'

JRR: dotted_name is 'rope'

JRR: dotted_name is 'java_config_2'

JRR: dotted_name is 'Cython'

JRR: dotted_name is 'deskbar'

JRR: dotted_name is 'PyQt4'

JRR: dotted_name is 'Pyrex'

JRR: dotted_name is 'OpenSSL'

JRR: dotted_name is 'antlr'

JRR: dotted_name is 'avahi'

JRR: dotted_name is 'cairo'

JRR: dotted_name is 'gdata'

JRR: dotted_name is 'hgext'

JRR: dotted_name is 'numpy'

JRR: dotted_name is 'psyco'

JRR: dotted_name is 'OpenGL'

JRR: dotted_name is 'speechd_config'


and it blows up because the speechd_config module cannot be imported except in
a special environment.  But then I really don't want it importing all the
other packages listed here either, for performance, stability and security
reasons.

Any ideas why this is happening?  Surely it isn't normal.

-Jeff



  File
"/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/zcml.py",
line 39, in autoIncludeDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
  File
"/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/dependency.py",
line 27, in includableInfo
    module = resolve(dotted_name)
  File
"/var/tmp/buildout/eggs/zope.dottedname-3.4.2-py2.5.egg/zope/dottedname/resolve.py",
line 32, in resolve
    found = __import__(used)
  File "//usr/lib/python2.5/site-packages/speechd_config/__init__.py", line
17, in <module>
    from config import *
  File "//usr/lib/python2.5/site-packages/speechd_config/config.py", line 28,
in <module>
    import paths
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"/home/jeff/Projects/grokwork/parts/app/site.zcml", line 4.0-4.30
    ZopeXMLConfigurationError: File
"/home/jeff/Projects/grokwork/src/grokwork/configure.zcml", line 4.2-4.37
    ImportError: No module named paths

(module 'paths' is part of speechd and should not be touched by Grok)
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Ethan Jucovy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmm, I think this is a bug in z3c.autoinclude.  It's importing the
locations to get their file paths so it can look for ZCML files to be
included.  But I *think* it could just as easily use
pkg_resources.resource_filename (which is safe AFAIK) to get those
paths.  I'll try to double check that this change doesn't have any
unintended consequences and put in the fix.

The case you're describing would be a good test, too; I'll try to add it.

(It's not trying to import everything in your site-packages, BTW --
just the things listed as install_requires dependencies in your
setup.py.)

In the meantime, you can turn off z3c.autoinclude's behavior entirely
by removing the <includeDependencies /> directive from your ZCML, but
you'll have to add some <include /> directives manually if you do.

FWIW, one of these days I'd like to add support for a sort of
blacklist of packages that z3c.autoinclude should stay away from
entirely.

Ethan

On Fri, May 22, 2009 at 11:17 AM, Jeff Rush <jeff@...> wrote:

> Hi, I'm just starting to check out Grok and when I do my first:
>
>  $ bin/python bin/zopectl fg
>
> it gives me a traceback that I've chased down to the z3c.autoinclude package
> trying to import everything in my site-packages.  That is a no-no.  I added
> print stmts and I see:
>
> $ bin/python bin/zopectl fg
>
> /home/jeff/Projects/grokwork/parts/app/runzope -C
>
> /home/jeff/Projects/grokwork/parts/zopectl/zope.conf
>
> JRR: include_candidates are ['configure.zcml', 'meta.zcml']
>
> JRR: dotted_name is 'bb'
>
> JRR: dotted_name is 'PIL'
>
> JRR: dotted_name is 'gsf'
>
> JRR: dotted_name is 'svn'
>
> JRR: dotted_name is 'atom'
>
> JRR: dotted_name is 'dbus'
>
> JRR: dotted_name is 'lxml'
>
> JRR: dotted_name is 'rope'
>
> JRR: dotted_name is 'java_config_2'
>
> JRR: dotted_name is 'Cython'
>
> JRR: dotted_name is 'deskbar'
>
> JRR: dotted_name is 'PyQt4'
>
> JRR: dotted_name is 'Pyrex'
>
> JRR: dotted_name is 'OpenSSL'
>
> JRR: dotted_name is 'antlr'
>
> JRR: dotted_name is 'avahi'
>
> JRR: dotted_name is 'cairo'
>
> JRR: dotted_name is 'gdata'
>
> JRR: dotted_name is 'hgext'
>
> JRR: dotted_name is 'numpy'
>
> JRR: dotted_name is 'psyco'
>
> JRR: dotted_name is 'OpenGL'
>
> JRR: dotted_name is 'speechd_config'
>
>
> and it blows up because the speechd_config module cannot be imported except in
> a special environment.  But then I really don't want it importing all the
> other packages listed here either, for performance, stability and security
> reasons.
>
> Any ideas why this is happening?  Surely it isn't normal.
>
> -Jeff
>
>
>
>  File
> "/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/zcml.py",
> line 39, in autoIncludeDirective
>    info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
>  File
> "/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/dependency.py",
> line 27, in includableInfo
>    module = resolve(dotted_name)
>  File
> "/var/tmp/buildout/eggs/zope.dottedname-3.4.2-py2.5.egg/zope/dottedname/resolve.py",
> line 32, in resolve
>    found = __import__(used)
>  File "//usr/lib/python2.5/site-packages/speechd_config/__init__.py", line
> 17, in <module>
>    from config import *
>  File "//usr/lib/python2.5/site-packages/speechd_config/config.py", line 28,
> in <module>
>    import paths
> zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
> "/home/jeff/Projects/grokwork/parts/app/site.zcml", line 4.0-4.30
>    ZopeXMLConfigurationError: File
> "/home/jeff/Projects/grokwork/src/grokwork/configure.zcml", line 4.2-4.37
>    ImportError: No module named paths
>
> (module 'paths' is part of speechd and should not be touched by Grok)
> _______________________________________________
> Grok-dev mailing list
> Grok-dev@...
> http://mail.zope.org/mailman/listinfo/grok-dev
>
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Martijn Faassen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ethan Jucovy wrote:
> Hmm, I think this is a bug in z3c.autoinclude.  It's importing the
> locations to get their file paths so it can look for ZCML files to be
> included.  But I *think* it could just as easily use
> pkg_resources.resource_filename (which is safe AFAIK) to get those
> paths.  I'll try to double check that this change doesn't have any
> unintended consequences and put in the fix.

That'd be good to see, thanks!

I think in this case things were aggravated by the "from config import
*" bit in speechd.

Regards,

Martijn

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Jeff Rush :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martijn Faassen wrote:

> Ethan Jucovy wrote:
>> Hmm, I think this is a bug in z3c.autoinclude.  It's importing the
>> locations to get their file paths so it can look for ZCML files to be
>> included.  But I *think* it could just as easily use
>> pkg_resources.resource_filename (which is safe AFAIK) to get those
>> paths.  I'll try to double check that this change doesn't have any
>> unintended consequences and put in the fix.
>
> That'd be good to see, thanks!
>
> I think in this case things were aggravated by the "from config import
> *" bit in speechd.

It is also interesting that I'm running it in a virtualenv --no-site-packages
and buildout, and it -still- is reaching out to my system site-packages to
find speechd.  I can't seem to keep its hands off my site. ;-)

-Jeff

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Jeff Rush :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ethan Jucovy wrote:
>
> (It's not trying to import everything in your site-packages, BTW --
> just the things listed as install_requires dependencies in your
> setup.py.)

Hmm, that's odd because this is a fresh install of Grok (grokproject mydemo)
with nothing added by me.  None of these packages are referenced by Grok, and
yet it is importing them:

  bb, gsf, svn, atom, dbus, rope, java_config_2,
  deskbar, PyQt4, antlr, avahi, cairo, hgext, numpy,
  OpenGL, speechd_config

> In the meantime, you can turn off z3c.autoinclude's behavior entirely
> by removing the <includeDependencies /> directive from your ZCML, but
> you'll have to add some <include /> directives manually if you do.

I'll try that - it seems safer.

-Jeff
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Michael Haubenwallner-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff Rush wrote:

> Hi, I'm just starting to check out Grok and when I do my first:
>
>   $ bin/python bin/zopectl fg
>
> it gives me a traceback that I've chased down to the z3c.autoinclude package
>
>   File
> "/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/zcml.py",
> line 39, in autoIncludeDirective
>     info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
>   File
> "/var/tmp/buildout/eggs/z3c.autoinclude-0.2.2-py2.5.egg/z3c/autoinclude/dependency.py",
> line 27, in includableInfo
>     module = resolve(dotted_name)
>   File
> "/var/tmp/buildout/eggs/zope.dottedname-3.4.2-py2.5.egg/zope/dottedname/resolve.py",
> line 32, in resolve
>     found = __import__(used)
>   File "//usr/lib/python2.5/site-packages/speechd_config/__init__.py", line
> 17, in <module>
>     from config import *
>   File "//usr/lib/python2.5/site-packages/speechd_config/config.py", line 28,
> in <module>
>     import paths
> zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
> "/home/jeff/Projects/grokwork/parts/app/site.zcml", line 4.0-4.30
>     ZopeXMLConfigurationError: File
> "/home/jeff/Projects/grokwork/src/grokwork/configure.zcml", line 4.2-4.37
>     ImportError: No module named paths
>
> (module 'paths' is part of speechd and should not be touched by Grok)

Which grokproject + python did you use
and how did you start the created project ("$ bin/python bin/zopectl fg"
looks wrong to me)?

Installation and startup could go like:

$ virtualenv --no-site-packages envname
$ cd envname
$ source bin/activate
$ bin/easy_install grokproject
$ bin/grokproject projectname
$ cd projectname
$ bin/projectname-ctl fg
- -- or --
$ bin/paster serve parts/etc7deploy.ini

Regards
Michael

- --
http://blog.d2m.at
http://planetzope.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKF9F9l0uAvQJUKVYRAnUxAKCYyFcqV7QZREMP5smAe6GihNECjQCgjazm
Fes5/OyaHw+X9+2jzlyv7uA=
=6b2/
-----END PGP SIGNATURE-----

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Vincent Fretin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've a similar problem.

I have a Plone instance working, i.e it starts properly.

Then I install inkscape with "apt-get install inkscape"
which installs as a dependency the python-uniconvertor package.

When I try to start my Plone instance, there is a z3c.autoinclude
error about uniconvertor.
Very weird. I've to remove python-uniconvertor package to be able to
start my instance properly.
I can send you the traceback if you can't reproduce it.

Cheers
--
Vincent Fretin
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Martijn Faassen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jeff Rush wrote:

> Martijn Faassen wrote:
>> Ethan Jucovy wrote:
>>> Hmm, I think this is a bug in z3c.autoinclude.  It's importing the
>>> locations to get their file paths so it can look for ZCML files to be
>>> included.  But I *think* it could just as easily use
>>> pkg_resources.resource_filename (which is safe AFAIK) to get those
>>> paths.  I'll try to double check that this change doesn't have any
>>> unintended consequences and put in the fix.
>> That'd be good to see, thanks!
>>
>> I think in this case things were aggravated by the "from config import
>> *" bit in speechd.
>
> It is also interesting that I'm running it in a virtualenv --no-site-packages
> and buildout, and it -still- is reaching out to my system site-packages to
> find speechd.  I can't seem to keep its hands off my site. ;-)

That is peculiar. I would suspect z3c.autoinclude again, but I don't
know how...

Ethan, can you replicate that behavior?

Regards,

Martijn

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Ethan Jucovy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, May 23, 2009 at 4:40 PM, Martijn Faassen <faassen@...> wrote:
> Jeff Rush wrote:
>> It is also interesting that I'm running it in a virtualenv --no-site-packages
>> and buildout, and it -still- is reaching out to my system site-packages to
>> find speechd.  I can't seem to keep its hands off my site. ;-)
>
> That is peculiar. I would suspect z3c.autoinclude again, but I don't
> know how...
>
> Ethan, can you replicate that behavior?

I haven't been able to yet.  Here's what I did:
{{{
virtualenv --no-site-packages groktest
cd groktest; source bin/activate
grokproject testproject
cd testproject
python setup.py develop
paster serve parts/etc/deploy.ini
}}}

I added print statements to z3c.autoinclude in dependency.py right
before the `zope.dottedname.resolve` line.  Everything that was being
touched was within the contained environment.  I then did `apt-get
install python-speechd inkscape` and restarted the paste server.  No
change, and everything started up fine.

Now that I had python-speechd and inkscape installed globally, I then
repeated the same procedure a second time.  Same results.

I'm pretty sure this isn't the standard way to start a new grok
project, though?  Neither Michael's instructions earlier in this
thread nor the documentation online at grok.zope.org mention `python
setup.py develop` .. and after I ran the above steps, z3c.autoinclude
was installed at v0.3.1, but there's a versions.cfg file in the
testproject layout that pins z3c.autoinclude to v0.2.2, which is the
version in Jeff's problematic traceback.

But running testproject/bin/buildout *without* explicitly installing
testproject via setup.py resulted in a "DistributionNotFound:testproj"
error when I started the paste server, so I'm not sure if I should be
doing something differently to try to reproduce this?  (Sorry; it's
been a while since I started a new grok project, and I've never, haha,
grokked buildout very well.)

I'm using Py2.5 on Ubuntu 8.04.

I'll also mention that I doubt the discrepency in z3c.autoinclude
versions is the problem here; IIRC the dependency.py code is almost
identical between the two versions.

egj
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Vincent Fretin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Ubuntu 8.10 with Python 2.4 with Plone 3.3rc3 which ships with
z3c.autoinclude 0.3.1
$ apt-get install python-uniconvertor
plonenext/3.3$ bin/instance fg
Oh I can't reproduce it with plonenext. Oh it's normal, Plone 3.3 only
use plugins and I don't have one here :-)

I go in my customer buildout then,
here I have a Products.extranetprivr which use includeDependencies in
configure.zcml:
$ bin/instance fg
ERROR: -C file is not found!

UniConvertor 1.1.2

USAGE: uniconvertor [INPUT FILE] [OUTPUT FILE]

Converts one vector graphics format to another using sK1 engine.
sK1 Team (http://sk1project.org), copyright (C) 2007,2008 by Igor E. Novikov

 Allowed input formats:
     AI  - Adobe Illustrator files (postscript based)
     CDR - CorelDRAW Graphics files (7-X3,X4 versions)
     CDT - CorelDRAW templates files (7-X3 versions)
     CCX - Corel Compressed Exchange files
     CMX - Corel Presentation Exchange files (CMX1 format)
     SVG - Scalable Vector Graphics files
     FIG - XFig files
     CGM - Computer Graphics Metafile files
     AFF - Draw files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

 Allowed output formats:
     AI  - Adobe Illustrator files (postscript based)
     SVG - Scalable Vector Graphics files
     CGM - Computer Graphics Metafile files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

Example: uniconvertor drawing.cdr drawing.svg


2009-05-24 08:49:40 ERROR Application Couldn't install Five
Traceback (most recent call last):
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/OFS/Application.py",
line 786, in install_product
    initmethod(context)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/Products/Five/__init__.py",
line 28, in initialize
    zcml.load_site()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/Products/Five/zcml.py",
line 53, in load_site
    _context = xmlconfig.file(file)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 579, in file
    include(context, name, package)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 515, in include
    processxmlfile(f, context)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 370, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 349, in endElementNS
    self.context.end()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 544, in end
    self.stack.pop().finish()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 692, in finish
    actions = self.handler(context, **args)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 515, in include
    processxmlfile(f, context)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 370, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 349, in endElementNS
    self.context.end()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 544, in end
    self.stack.pop().finish()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 692, in finish
    actions = self.handler(context, **args)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 515, in include
    processxmlfile(f, context)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 370, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 349, in endElementNS
    self.context.end()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 544, in end
    self.stack.pop().finish()
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
line 692, in finish
    actions = self.handler(context, **args)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/zcml.py",
line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml',
'meta.zcml'])
  File "/home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/dependency.py",
line 24, in includableInfo
    module = resolve(dotted_name)
  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/dottedname/resolve.py",
line 32, in resolve
    found = __import__(used)
  File "/usr/lib/python2.4/site-packages/uniconvertor/__init__.py",
line 54, in ?
    sys.exit(1)
SystemExit: 1

I included import pdb;pdb.set_trace() after line 22 in
/home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/dependency.py
dist_manager.dottedNames() returns
['deskbar', 'uniconvertor', 'Pyrex', 'DistUpgrade', 'Alacarte',
'launchpadbugs', 'telepathy', 'cairo', 'translate', 'PIL',
'NvidiaDetector', 'pymsn', 'UpdateManager', 'apt', 'aptsources',
'lxml', 'pyatspi', 'numpy', 'softwareproperties', 'setuptools',
'Crypto', 'XKit', 'butterfly', 'enchant', 'pysqlite2']

get_provider(req)
returns
setuptools 0.6c9 (/usr/lib/python2.4/site-packages)

--
Vincent Fretin
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Vincent Fretin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, May 24, 2009 at 9:03 AM, Vincent Fretin
<vincent.fretin@...> wrote:

> On Ubuntu 8.10 with Python 2.4 with Plone 3.3rc3 which ships with
> z3c.autoinclude 0.3.1
> $ apt-get install python-uniconvertor
> plonenext/3.3$ bin/instance fg
> Oh I can't reproduce it with plonenext. Oh it's normal, Plone 3.3 only
> use plugins and I don't have one here :-)
>
> I go in my customer buildout then,
> here I have a Products.extranetprivr which use includeDependencies in
> configure.zcml:
> $ bin/instance fg
> ERROR: -C file is not found!
>
> UniConvertor 1.1.2
>
> USAGE: uniconvertor [INPUT FILE] [OUTPUT FILE]
>
> Converts one vector graphics format to another using sK1 engine.
> sK1 Team (http://sk1project.org), copyright (C) 2007,2008 by Igor E. Novikov
>
>  Allowed input formats:
>     AI  - Adobe Illustrator files (postscript based)
>     CDR - CorelDRAW Graphics files (7-X3,X4 versions)
>     CDT - CorelDRAW templates files (7-X3 versions)
>     CCX - Corel Compressed Exchange files
>     CMX - Corel Presentation Exchange files (CMX1 format)
>     SVG - Scalable Vector Graphics files
>     FIG - XFig files
>     CGM - Computer Graphics Metafile files
>     AFF - Draw files
>     WMF - Windows Metafile files
>     SK  - Sketch/Skencil files
>     SK1 - sK1 vector graphics files
>
>  Allowed output formats:
>     AI  - Adobe Illustrator files (postscript based)
>     SVG - Scalable Vector Graphics files
>     CGM - Computer Graphics Metafile files
>     WMF - Windows Metafile files
>     SK  - Sketch/Skencil files
>     SK1 - sK1 vector graphics files
>
> Example: uniconvertor drawing.cdr drawing.svg
>
>
> 2009-05-24 08:49:40 ERROR Application Couldn't install Five
> Traceback (most recent call last):
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/OFS/Application.py",
> line 786, in install_product
>    initmethod(context)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/Products/Five/__init__.py",
> line 28, in initialize
>    zcml.load_site()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/Products/Five/zcml.py",
> line 53, in load_site
>    _context = xmlconfig.file(file)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 579, in file
>    include(context, name, package)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 515, in include
>    processxmlfile(f, context)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 370, in processxmlfile
>    parser.parse(src)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
>    xmlreader.IncrementalParser.parse(self, source)
>  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
>    self.feed(buffer)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
>    self._parser.Parse(data, isFinal)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
>    self._cont_handler.endElementNS(pair, None)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 349, in endElementNS
>    self.context.end()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 544, in end
>    self.stack.pop().finish()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 692, in finish
>    actions = self.handler(context, **args)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 515, in include
>    processxmlfile(f, context)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 370, in processxmlfile
>    parser.parse(src)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
>    xmlreader.IncrementalParser.parse(self, source)
>  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
>    self.feed(buffer)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
>    self._parser.Parse(data, isFinal)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
>    self._cont_handler.endElementNS(pair, None)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 349, in endElementNS
>    self.context.end()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 544, in end
>    self.stack.pop().finish()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 692, in finish
>    actions = self.handler(context, **args)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 515, in include
>    processxmlfile(f, context)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 370, in processxmlfile
>    parser.parse(src)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
>    xmlreader.IncrementalParser.parse(self, source)
>  File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
>    self.feed(buffer)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
>    self._parser.Parse(data, isFinal)
>  File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
>    self._cont_handler.endElementNS(pair, None)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
> line 349, in endElementNS
>    self.context.end()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 544, in end
>    self.stack.pop().finish()
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/configuration/config.py",
> line 692, in finish
>    actions = self.handler(context, **args)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/zcml.py",
> line 51, in includeDependenciesDirective
>    info = DependencyFinder(dist).includableInfo(['configure.zcml',
> 'meta.zcml'])
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/dependency.py",
> line 24, in includableInfo
>    module = resolve(dotted_name)
>  File "/home/vincentfretin/workspace/ExtranetPRIVR/parts/zope2/lib/python/zope/dottedname/resolve.py",
> line 32, in resolve
>    found = __import__(used)
>  File "/usr/lib/python2.4/site-packages/uniconvertor/__init__.py",
> line 54, in ?
>    sys.exit(1)
> SystemExit: 1
>
> I included import pdb;pdb.set_trace() after line 22 in
> /home/vincentfretin/workspace/ExtranetPRIVR/eggs/z3c.autoinclude-0.3.1-py2.4.egg/z3c/autoinclude/dependency.py
> dist_manager.dottedNames() returns
> ['deskbar', 'uniconvertor', 'Pyrex', 'DistUpgrade', 'Alacarte',
> 'launchpadbugs', 'telepathy', 'cairo', 'translate', 'PIL',
> 'NvidiaDetector', 'pymsn', 'UpdateManager', 'apt', 'aptsources',
> 'lxml', 'pyatspi', 'numpy', 'softwareproperties', 'setuptools',
> 'Crypto', 'XKit', 'butterfly', 'enchant', 'pysqlite2']
>
> get_provider(req)
> returns
> setuptools 0.6c9 (/usr/lib/python2.4/site-packages)
>
> --
> Vincent Fretin
>
and in the for loop above
self.context.requires()
returns
[Requirement.parse('setuptools'),
Requirement.parse('extranetprivr.portlet.addevent'),
Requirement.parse('extranetprivr.theme'),
Requirement.parse('Products.extranetprivr')]

Oh, interresing.
self.context is here extranetprivr.policy
In src/extranetprivr.policy/setup.py I have
      install_requires=[
          'setuptools',
          'extranetprivr.portlet.addevent',
          'extranetprivr.theme',
          'Products.extranetprivr',
          # -*- Extra requirements: -*-
      ],

and <includeDependencies package="." /> in
src/extranetprivr.policy/extranetprivr/policy/configure.zcml

The problem seems reproducible if you don't have your own copy of
setuptools in your buildout, but your buildout use the one from the
system (installed with apt-get install python-setuptools), and Ubuntu
8.10 ships will latest setuptools 0.6c9, so buildout don't have to
upgrade it here.

--
Vincent Fretin
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Jeff Rush :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Haubenwallner wrote:
>
> Which grokproject + python did you use

grokproject 1.0a4  from latest PyPI
Python 2.5.4

> and how did you start the created project ("$ bin/python bin/zopectl fg"
> looks wrong to me)?
>
> Installation and startup could go like:
>
> $ virtualenv --no-site-packages envname
> $ cd envname
> $ source bin/activate
> $ bin/easy_install grokproject
> $ bin/grokproject projectname
> $ cd projectname
> $ bin/projectname-ctl fg
> -- or --
> $ bin/paster serve parts/etc7deploy.ini

Mine is similar but not quite ;-)

First, I decided to install grokproject -once- into the system Python, along
the same lines as virtualenv since they are both used once to -start- new
projects but are not really an ongoing part of a project.  It avoids the need
to re-install grokproject for each project, which seemed odd to me, to install
and use something once, and then install and use it again once for the next
project.

 $ sudo easy_install grokproject

 $ cd /var/tmp
 $ virtualenv --no-site-packages myproject

I found the bin/paster line too long to remember so I selected the option to
mimic the traditional zopectl approach with which I'm most familiar.

 $ grokproject --zopectl myproject
 $ cd myproject
 $ source bin/activate

I don't see any "bin/projectname-ctl" script as you are using but there is a
"bin/zopectl".  Unfortunately it has the incorrect shebang line of
"#!/usr/bin/python" instead of one pointing to the Python within the sandbox,
so I invoked zopectl with the correct Python:

 $ bin/python bin/zopectl fg

And it then walked all my packages and gave me an exception traceback when it
hit the speechd package.  No idea why it is touching non-Zope packages.

-Jeff
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Ethan Jucovy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, May 24, 2009 at 10:12 PM, Jeff Rush <jeff@...> wrote:
And it then walked all my packages and gave me an exception traceback when it
hit the speechd package.  No idea why it is touching non-Zope packages.

Still haven't managed to reproduce this .. it's all very strange to me.

Hmm .. could you see what "dist" is, and what `dist.requires()` returns, in your broken setup's zcml.py `autoIncludeDirective`?

Here's what z3c.autoinclude is trying to do..

1) `autoIncludeDirective` in zcml.py is invoked by a ZCML directive somewhere.  (grokproject creates the following directive in your new project's configure.zcml: <includeDependencies package="." />)
2) `autoIncludeDirective` takes the package passed in from the ZCML directive, which at this point has already been resolved into a Python module object.
3) `distributionForPackage` takes that module object and determines what distribution (egg) the module was provided by.  This function is really hairy (mostly because of virtual namespace packages) and *does* touch everything in your sys.path but it doesn't look like it's where your problem is coming from.
4) Now autoinclude has a setuptools Distribution object.  It asks that object for the distributions listed in its "install_requires" (that's the `self.context.requires()` line, going through the pkg_resources API -- self.context being the Distribution) and pokes at each of those to find ZCML files to include.

So if there's any place where unexpected packages would be touched, I would suspect step #3.  But from the traceback it looks like it's happening in step #4, even though step #4 should only be looping over packages that are explicitly required by your project.

You might also try upgrading to z3c.autoinclude v0.3.1.  One significant difference is that v0.2 imports setuptools, which I've heard is a Bad Idea because it triggers some monkeypatching.  Don't know why that would result in this error, though.

I'd also be curious whether the error goes away if you downgrade to z3c.autoinclude v0.1, but now I'm probably asking way too much :)

egj

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Michael Haubenwallner-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff Rush wrote:
> First, I decided to install grokproject -once- into the system Python,
along
> the same lines as virtualenv since they are both used once to -start- new
> projects but are not really an ongoing part of a project.  It avoids
the need
> to re-install grokproject for each project, which seemed odd to me, to
install
> and use something once, and then install and use it again once for the
next
> project.
>
>  $ sudo easy_install grokproject
>

If you already used Zope3 chances are that you now have a broken Zope3
library in your system python site-packages. The Grok tutorial has
detailed instructions on that topic.

>  $ cd /var/tmp
>  $ virtualenv --no-site-packages myproject
>

When installing grokproject with the system python there is no mor e nee
to use a virtualenv, especially using a virtualenv --no-site-packages
cuts you off everything installed into the pythons site-packages folder.

> I found the bin/paster line too long to remember so I selected the
option to
> mimic the traditional zopectl approach with which I'm most familiar.
>
>  $ grokproject --zopectl myproject
>  $ cd myproject
>  $ source bin/activate
>
> I don't see any "bin/projectname-ctl" script as you are using but
there is a
> "bin/zopectl".  Unfortunately it has the incorrect shebang line of
> "#!/usr/bin/python" instead of one pointing to the Python within the
sandbox,
> so I invoked zopectl with the correct Python:
>
>  $ bin/python bin/zopectl fg
>

"bin/projectname-ctl" is only created with the new paster based project
layout.

"bin/zopectl fg" should work ootb, as it is configured for the python
interpreter you installed grokproject with.

> And it then walked all my packages and gave me an exception traceback
when it
> hit the speechd package.  No idea why it is touching non-Zope packages.
>

Try again running somthing like:

$ grokproject --zopectl projectname
$ cd projectname
$ bin/zopectl fg

Regards
Michael

- --
http://blog.d2m.at
http://planetzope.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKGiKAl0uAvQJUKVYRAidZAKCxotyt8l+y/u4lGqbvmV5rm7wWGgCgtoKW
Qt3eaDeaBZCWPCHLMkWetXA=
=Tsis
-----END PGP SIGNATURE-----

_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Roger Erens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

on 25-5-2009 4:12 Jeff Rush wrote:
...
>  $ grokproject --zopectl myproject
>  $ cd myproject
>  $ source bin/activate
>
> I don't see any "bin/projectname-ctl" script as you are using but there is a
> "bin/zopectl".  Unfortunately it has the incorrect shebang line of
> "#!/usr/bin/python" instead of one pointing to the Python within the sandbox,
> so I invoked zopectl with the correct Python:

Hi Jeff,

the correct shebang line would probably have been put in bin/zopectl if
you had sourced bin/activate _before_ issueing the grokproject command.

Roger
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Graham Stratton-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 25 May 2009, at 13:32, Ethan Jucovy wrote:

> On Sun, May 24, 2009 at 10:12 PM, Jeff Rush <jeff@...> wrote:
> And it then walked all my packages and gave me an exception  
> traceback when it
> hit the speechd package.  No idea why it is touching non-Zope  
> packages.
>
> Still haven't managed to reproduce this .. it's all very strange to  
> me.
>
> Hmm .. could you see what "dist" is, and what `dist.requires()`  
> returns, in your broken setup's zcml.py `autoIncludeDirective`?
>
> Here's what z3c.autoinclude is trying to do..
>
> 1) `autoIncludeDirective` in zcml.py is invoked by a ZCML directive  
> somewhere.  (grokproject creates the following directive in your new  
> project's configure.zcml: <includeDependencies package="." />)
> 2) `autoIncludeDirective` takes the package passed in from the ZCML  
> directive, which at this point has already been resolved into a  
> Python module object.
> 3) `distributionForPackage` takes that module object and determines  
> what distribution (egg) the module was provided by.  This function  
> is really hairy (mostly because of virtual namespace packages) and  
> *does* touch everything in your sys.path but it doesn't look like  
> it's where your problem is coming from.
> 4) Now autoinclude has a setuptools Distribution object.  It asks  
> that object for the distributions listed in its  
> "install_requires" (that's the `self.context.requires()` line, going  
> through the pkg_resources API -- self.context being the  
> Distribution) and pokes at each of those to find ZCML files to  
> include.
>
> So if there's any place where unexpected packages would be touched,  
> I would suspect step #3.  But from the traceback it looks like it's  
> happening in step #4, even though step #4 should only be looping  
> over packages that are explicitly required by your project.
>
> You might also try upgrading to z3c.autoinclude v0.3.1.  One  
> significant difference is that v0.2 imports setuptools, which I've  
> heard is a Bad Idea because it triggers some monkeypatching.  Don't  
> know why that would result in this error, though.


I also seem to be having this issue. I'm running OSX, not using the  
system Python. The grok instance I'm running has been updated a lot  
since it was created, so probably isn't as clean as it could be, but  
the buildout file it is based on a copy of that produced by the latest  
grokproject.

Has this issue been solved or should I try to investigate further?

The traceback is below. Many thanks,

Graham

2009-10-29T08:03:00 WARNING root Developer mode is enabled: this is a  
security risk and should NOT be enabled on production servers.  
Developer mode can be turned off in etc/zope.conf
Traceback (most recent call last):
  File "./bin/grokstar-debug", line 128, in <module>
    grokstar.startup.interactive_debug_prompt()
  File "/Users/graham/development/zopeorggrokstar/src/grokstar/
startup.py", line 13, in interactive_debug_prompt
    db = zope.app.wsgi.config(zope_conf)
  File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
macosx-10.3-i386.egg/__init__.py", line 124, in config

  File "/Users/graham/.buildout/eggs/tmpVKUl1q/zope.app.appsetup-3.4.1-
py2.5.egg/zope/app/appsetup/appsetup.py", line 111, in config
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 610, in file
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 546, in include
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 378, in processxmlfile
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 107, in  
parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python2.5/xml/sax/xmlreader.py", line 123, in  
parse
    self.feed(buffer)
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 207, in  
feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 349, in  
end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 357, in endElementNS
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line  
542, in end
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line  
690, in finish
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 546, in include
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 378, in processxmlfile
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 107, in  
parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python2.5/xml/sax/xmlreader.py", line 123, in  
parse
    self.feed(buffer)
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 207, in  
feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 349, in  
end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",  
line 357, in endElementNS
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line  
542, in end
  File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line  
690, in finish
  File "/Users/graham/.buildout/eggs/z3c.autoinclude-0.3.1-py2.5.egg/
z3c/autoinclude/zcml.py", line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml',  
'meta.zcml'])
  File "/Users/graham/.buildout/eggs/z3c.autoinclude-0.3.1-py2.5.egg/
z3c/autoinclude/dependency.py", line 24, in includableInfo
    module = resolve(dotted_name)
  File "/Users/graham/.buildout/eggs/tmpe64Jup/zope.dottedname-3.4.2-
py2.5.egg/zope/dottedname/resolve.py", line 32, in resolve
  File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
macosx-10.3-i386.egg/__init__.py", line 16, in <module>

zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/
graham/development/zopeorggrokstar/etc/site.zcml", line 4.2-4.32
    ZopeXMLConfigurationError: File "/Users/graham/development/
zopeorggrokstar/src/grokstar/configure.zcml", line 4.2-4.37
    ImportError: No module named wx
_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Kevin Teague :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 28, 2009, at 2:15 PM, Graham Stratton wrote:

>
>  File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
> macosx-10.3-i386.egg/__init__.py", line 16, in <module>
>

Don't really know anything about this specific issue, but this  
traceback suggests that you have an __init__.py file in the top-level  
of your PIL egg. Which is odd. Can you confirm that this file exists,  
and what it's contents are?

_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Graham Stratton-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 29 Oct 2009, at 17:21, Kevin Teague wrote:

> On Oct 28, 2009, at 2:15 PM, Graham Stratton wrote:
>
>>
>> File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
>> macosx-10.3-i386.egg/__init__.py", line 16, in <module>
>>
>
> Don't really know anything about this specific issue, but this
> traceback suggests that you have an __init__.py file in the top-level
> of your PIL egg. Which is odd. Can you confirm that this file exists,
> and what it's contents are?

Well, I can; it's contents are listed below: all whitespace and  
comments. But the application doesn't include PIL anywhere, so this  
definitely looks like the bug discussed earlier in this thread.

Thanks,

Graham


#
# The Python Imaging Library.
# $Id: __init__.py 2134 2004-10-06 08:55:20Z fredrik $
#
# package placeholder
#
# Copyright (c) 1999 by Secret Labs AB.
#
# See the README file for information on usage and redistribution.
#

# ;-)
_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev

Re: Wierd Thing: Grok Groping All Modules?

by Ethan Jucovy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

AFAIK the issue has not been solved -- anything you could do to investigate further or come up with a reproduction recipe would be very helpful.  But I don't think I'll have any time to get around to looking at this for a couple of weeks.

It occurs to me that a minimal patch could just wrap the autoinclude includeableInfo()'s `module = resolve(dotted_name)` with a `try .. except ImportError`.  That would probably be a good idea no matter what, and I think would resolve all of the bugs reported in this thread.  But I'd still like to get to the bottom of this -- autoinclude shouldn't be able to get at the system-level packages in an isolated environment in the way the OP described.

Thanks,
Ethan

On Wed, Oct 28, 2009 at 5:15 PM, Graham Stratton <gns24@...> wrote:

On 25 May 2009, at 13:32, Ethan Jucovy wrote:

> On Sun, May 24, 2009 at 10:12 PM, Jeff Rush <jeff@...> wrote:
> And it then walked all my packages and gave me an exception
> traceback when it
> hit the speechd package.  No idea why it is touching non-Zope
> packages.
>
> Still haven't managed to reproduce this .. it's all very strange to
> me.
>
> Hmm .. could you see what "dist" is, and what `dist.requires()`
> returns, in your broken setup's zcml.py `autoIncludeDirective`?
>
> Here's what z3c.autoinclude is trying to do..
>
> 1) `autoIncludeDirective` in zcml.py is invoked by a ZCML directive
> somewhere.  (grokproject creates the following directive in your new
> project's configure.zcml: <includeDependencies package="." />)
> 2) `autoIncludeDirective` takes the package passed in from the ZCML
> directive, which at this point has already been resolved into a
> Python module object.
> 3) `distributionForPackage` takes that module object and determines
> what distribution (egg) the module was provided by.  This function
> is really hairy (mostly because of virtual namespace packages) and
> *does* touch everything in your sys.path but it doesn't look like
> it's where your problem is coming from.
> 4) Now autoinclude has a setuptools Distribution object.  It asks
> that object for the distributions listed in its
> "install_requires" (that's the `self.context.requires()` line, going
> through the pkg_resources API -- self.context being the
> Distribution) and pokes at each of those to find ZCML files to
> include.
>
> So if there's any place where unexpected packages would be touched,
> I would suspect step #3.  But from the traceback it looks like it's
> happening in step #4, even though step #4 should only be looping
> over packages that are explicitly required by your project.
>
> You might also try upgrading to z3c.autoinclude v0.3.1.  One
> significant difference is that v0.2 imports setuptools, which I've
> heard is a Bad Idea because it triggers some monkeypatching.  Don't
> know why that would result in this error, though.


I also seem to be having this issue. I'm running OSX, not using the
system Python. The grok instance I'm running has been updated a lot
since it was created, so probably isn't as clean as it could be, but
the buildout file it is based on a copy of that produced by the latest
grokproject.

Has this issue been solved or should I try to investigate further?

The traceback is below. Many thanks,

Graham

2009-10-29T08:03:00 WARNING root Developer mode is enabled: this is a
security risk and should NOT be enabled on production servers.
Developer mode can be turned off in etc/zope.conf
Traceback (most recent call last):
 File "./bin/grokstar-debug", line 128, in <module>
   grokstar.startup.interactive_debug_prompt()
 File "/Users/graham/development/zopeorggrokstar/src/grokstar/
startup.py", line 13, in interactive_debug_prompt
   db = zope.app.wsgi.config(zope_conf)
 File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
macosx-10.3-i386.egg/__init__.py", line 124, in config

 File "/Users/graham/.buildout/eggs/tmpVKUl1q/zope.app.appsetup-3.4.1-
py2.5.egg/zope/app/appsetup/appsetup.py", line 111, in config
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 610, in file
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 546, in include
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 378, in processxmlfile
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 107, in
parse
   xmlreader.IncrementalParser.parse(self, source)
 File "/usr/local/lib/python2.5/xml/sax/xmlreader.py", line 123, in
parse
   self.feed(buffer)
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 207, in
feed
   self._parser.Parse(data, isFinal)
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 349, in
end_element_ns
   self._cont_handler.endElementNS(pair, None)
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 357, in endElementNS
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line
542, in end
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line
690, in finish
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 546, in include
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 378, in processxmlfile
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 107, in
parse
   xmlreader.IncrementalParser.parse(self, source)
 File "/usr/local/lib/python2.5/xml/sax/xmlreader.py", line 123, in
parse
   self.feed(buffer)
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 207, in
feed
   self._parser.Parse(data, isFinal)
 File "/usr/local/lib/python2.5/xml/sax/expatreader.py", line 349, in
end_element_ns
   self._cont_handler.endElementNS(pair, None)
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/xmlconfig.py",
line 357, in endElementNS
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line
542, in end
 File "/Users/graham/.buildout/eggs/tmpcEOKao/
zope.configuration-3.4.0-py2.5.egg/zope/configuration/config.py", line
690, in finish
 File "/Users/graham/.buildout/eggs/z3c.autoinclude-0.3.1-py2.5.egg/
z3c/autoinclude/zcml.py", line 51, in includeDependenciesDirective
   info = DependencyFinder(dist).includableInfo(['configure.zcml',
'meta.zcml'])
 File "/Users/graham/.buildout/eggs/z3c.autoinclude-0.3.1-py2.5.egg/
z3c/autoinclude/dependency.py", line 24, in includableInfo
   module = resolve(dotted_name)
 File "/Users/graham/.buildout/eggs/tmpe64Jup/zope.dottedname-3.4.2-
py2.5.egg/zope/dottedname/resolve.py", line 32, in resolve
 File "/usr/local/lib/python2.5/site-packages/PIL-1.1.6-py2.5-
macosx-10.3-i386.egg/__init__.py", line 16, in <module>

zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/
graham/development/zopeorggrokstar/etc/site.zcml", line 4.2-4.32
   ZopeXMLConfigurationError: File "/Users/graham/development/
zopeorggrokstar/src/grokstar/configure.zcml", line 4.2-4.37
   ImportError: No module named wx
_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev


_______________________________________________
Grok-dev mailing list
Grok-dev@...
https://mail.zope.org/mailman/listinfo/grok-dev