[Zope-dev] Options problems with 2.7 and Zope.configure("/instance/etc/zope.conf")

Erik A.Dahl edahl at confmon.com
Sat Feb 14 15:23:54 EST 2004


I'm moving a bunch of scripts that do the import Zope, app=Zope.app() 
dance to 2.7.  I added the configure call and things were find until I 
ran a script that had positional arguments.  This gave me a "ERROR: 
positional arguments are not supported".  This comes from 
zdoptions.py:226.  Basically zdoptions.py is parsing sys.argv.  I don't 
think it needs to do this from the Zope.configure call since it is 
getting the config from zope.conf.  We could prevent the sys.argv parse 
by passing changing lib/python/Zope/Startup/run.py:39 to:

         opts.realize(args=[], doc="Sorry, no option docs yet.", 
raise_getopt_errs=0)

It looks like all that zdoptions.py is looking for in sys.argv is its 
configfile.  Since we passed this in to Zope.configure it doesn't seem 
nessesary.  Would this mess other stuff up?  I don't want zope parsing 
my script options!

-EAD




More information about the Zope-Dev mailing list