[Zope-DB] Pitfall: mxODBCZopeDA and test runner in 2.9+

Paul Winkler pw_lists at slinkp.com
Fri Oct 13 09:43:58 EDT 2006


On Fri, Oct 13, 2006 at 12:46:27PM +0200, M.-A. Lemburg wrote:
> Sounds like a developer setup :-)
> 
> For those I do have a solution:
> 
> chown root.zope .../Products/mxODBCZopeDA
> chmod 750 .../Products/mxODBCZopeDA
> 
> (provided zope is the group of the Zope daemon)
> 
> That way you prevent deletions in the product directory
> by any user other than root.

Yes, Tres suggested that on another list. But doing this also
prevents the test runner from running any tests :-)
It bails out with errors like:

Traceback (most recent call last):
(snip)
  File "/home/pw/rhg/code/contentservices_dev/opt/Zope-2.9.1/lib/python/zope/testing/testrunner.py", line 1116, in remove_stale_bytecode
    os.unlink(fullname)
OSError: [Errno 13] Permission denied: 
'/home/pw/dev/instances/zope/lib/python/mx/ODBC/__init__.pyc'

I think for my use case, your workaround of putting mxODBCZopeDA
under SoftwareHome is probably the best.  
I'm currently using the test -k flag to prevent bytecode deletion,
but it's only a matter of time before that causes me pain of the
sort Chris described.

I'll put the mx libs in my python site-packages too (since the
testrunner also deletes bytecode in $INSTANCE_HOME/lib/python).
Shouldn't be a problem for licensing since our buildout system creates a
dedicated "private" python installation; we're not currently sharing
python or SOFTWARE_HOME across multiple instances, and I doubt we'll
start doing that because it'd take some hacking on the build scripts so
it's much cheaper to just keep wasting disk space.

Thanks for the input everybody,

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope-DB mailing list