Package: repoze.zope2
Overviewrepoze.zope2 is a decomposition of the Zope 2 appserver publicationmachinery (ZPublisher) into a WSGI application component.  It relieson separately-distributed middleware pieces to perform some of thefeatures previously handled by ZPublisher and other parts of Zope 2.Installing repoze.zope2With a Python 2.4 interpreter >= 2.4.3 (**Python 2.5+ isunsupported**) with setuptools installed, install the 'virtualenv'package::$PYTHONHOME/bin/easy_install virtualenvWhen this is done, create a virtualenv "sandbox" to hold therepoze.zope2 packages and instance data:$PYTHONHOME/bin/virtualenv --no-site-packages /path/to/sandboxA directory named 'sandbox' will be created in the /path/to.directory.  You can use any path you like.After creating a virtualenv sandbox, install the 'repoze.zope2' egginto the virtualenv./path/to/sandbox/bin/easy_install -i http://dist.repoze.org/simple repoze.zope2NOTE: Some "Syntax Error" messages may be printed to the consoleduring this process; these can be ignored.  This is distutilsattempting to byte-compile Zope "Python Scripts" in skin directoriesthat aren't valid Python syntax.After the repoze.zope2 packages are installed into the virtualenv,you can finally create "instance" files (config files) within thesandbox by running "mk2zope2instance"::/path/to/sandbox/bin/mkzope2instanceAfter these steps have been performed, here's what has happened::- a "virtual Python" has been installed within the"/path/to/sandbox" directory.  Packages installed to this virtualPython's 'site-packages' directory will not conflict with packagesinstalled into your "normal" Python's 'site-packages' directory.- All packages required by repoze.zope2 have beeen downloaded,compiled, and installed as Python eggs in the *virtual* Python's'site-packages' directory.- 'Products', 'logs', 'var', and 'etc' directories have been createdinside the sandbox directory.  'Products' is where 3rd party Zopeproducts should be installed.  'logs' is where Zope logs will go,'var' is where ZODB data files will go, 'etc' is where configfiles are placed.- A sample set of configuration files have been installed into thesandbox directory's 'etc' subdirectory.  These include::- 'zope.ini', a Paste configuration file used to establish thePaste (WSGI) pipeline which repoze.zope2 will use to serve uprepoze.zope2.- 'zope.conf', a classic Zope 2 configuration file which can beused to adjust Zope settings.- 'site.zcml', a boilerplate site.zcml that should be used tocontrol ZCML processing.The Default Sandbox ConfigurationThe configuration of WSGI components in the sandbox setup form apublishing environment in which most Zope applications should beable to run without modification.  Some of the jobs previouslyfilled by components in Zope have been assumed by repoze and otherWSGI middleware components:- The job of ZServer has been filled by the zope 3 WSGI server (viarepoze.zope2.server).- The job of ZPublisher object publishing has been filled by theobject publisher in repoze.zope2- The job of ZPublisher transaction management has been filled byrepoze.tm middleware.- The Zope 2 "error_log" has been replaced with error-catching /error-logging middleware in Paste.  (Visit /__error_log__ to seethe exception history).- "access" logging can now be handled by a middleware component.- The job of VirtualHostMonster is now filled by repoze.vhm.UtilitiesThese utilities are available in the "bin/" directory of thegenerated sandbox.installproduct -- provided the directory path of a classic Zope 2Product (unpacked), installproduct will attempt to convert theproduct into a Python egg and install it into the sandbox'ssite-packages directory.  This is an alternative to unpackingputting the product inside the sandbox "Products" directory.addzope2user -- script which adds a management user to the Zope rootuser folder.runzope2script -- script which runs a Python script with the rootZope application object as the "app" object in the globalsnamespace.debugzope2 -- runs the Python interactive interpreter with the Zoperoot object bound to the "app" name in the global dictionary/mkzope2instance -- create zope2 instance files in a directory.Testing repoze.zope2To all run repoze.zope2 tests, after running setup.py sandbox, cd tothe repoze.zope2 directory and run::$sandboxdir/bin/python setup.py testStarting repoze.zope2To start a server that serves up a demo app on port 8080, cd to thesandbox directory you created via "setup.py sandbox" and run::bin/paster serve etc/zope2.iniWhen you visit http://localhost:8080/ in a browser, you should seethe Zope 2 quickstart page.To manage the resulting Zope 2 site, you'll need to add amanagement user.  From the sandbox directory, run::bin/zope2adduser <username> <password>Once this is done, you should be able to visithttp://localhost:8080/manage and log in with the username andpassword you supplied.DeployingDue to its simplicity, the default "sandbox" server is preferred fordevelopment and for some forms of deployment, but to make lifeeasier for people more experienced with Apache technologies thanZope technologies, a reasonable deployment target for repoze.zope2is Apache via "mod_wsgi":http://code.google.com/p/modwsgi/ .mod_wsgi is an Apache module that allows you to run WSGIapplications using the Apache HTTP server.A sample ".wsgi" deployment script (an analogue of the onesdescribed in the mod_wsgi documentation) is available in thedoc/sample_zope2.wsgi file.  A sample Apache configuration whichuses this deployment script is included in thedoc/sample_apache2.conf file.It's suggested that you serve up repoze.zope2 with mod_wsgi in"daemon mode" where each if the mod_wsgi's daemon children runs asingle-threaded Zope process.  All of the Zope processes shouldcommunicate with a single ZEO server on the back end.  You can run aZEO server by invoking "bin/zeoctl start -C etc/zeo.conf" fromwithin a Repoze sandbox.  You'll need to change etc/zope.conf,uncommenting the <zodb_db> section that refers to a client storageat that point for Zope to work.CHANGES1.0.3 (2009-10-12)- Fix URL quoting on ACTUAL_URL and URL (both need to be quoted).1.0.2 (2009-08-31)- Add support for views-on-exceptions. This exists in Zope 2.12 and priorto that via the FiveException package. You can now register a view ontoan exception class with the name 'index.html'. If found, this will berendered when the exception is caught. Note that the transaction will beaborted regardless. This feature only works on ZODB 3.8 and later, becauseit depends on the 'doom()' feature of that version. If doom() is notavailable, the exception view will be ignored.- Calculate PATH_TRANSLATED in the same way as Zope 2.- Respect VIRTUAL_URL when computing ACTUAL_URL. VIRTUAL_URL may be set uprepoze.vhm >= 0.11, for example, and contains the URL that the user sees.- When virtual hosting using repoze.vhm is used, and there is a VHM root,and if that path is present in the PATH_INFO, avoid traversing to theVHM root objects twice.1.0.1 (2009-26-8)- If an IPublishTraverse raises KeyError or AttributeError, the standardZope 2 publisher treats it as a 404. Now z2bob does as well.1.0 (2008-28-11)- No changes from 0.4.6; declare it 1.0 in order to kick off the 1.Xbranch.  The repoze.zope2 trunk will now be the home of the 2.Xversion.0.4.6 (2008-07-03)- During helper teardown, clear out reference to request.response,so in case the request is leaked, the tempfile associated with theresponse isn't.0.4.5 (2008-06-26)- Make disable_gc only happen at initialization.  Drool.0.4.4 (2008-06-25)- Add a configuration flag for the app:zope2 section: 'disable_gc'.If this flag exists and is true, disable Python garbage collectionfor the interpreter used to start the process.  This flag probablydoesn't belong here.- More explictly call noSecurityManager and clear out instancevariables in the bob helper's .teardown method in case a helperever leaks.- Belatedly change Trove classifier to "Development Status :: 4 - Beta"(it was "Development Status :: 1 - Planning").0.4.3 (2008-06-18)- Dont attempt any retries on conflict errors at startup.This was never tested, and probably didn't work.- Headers added to the response via "response.addHeaders" (akaaccumulated_headers) were not returned in the response headerlist.- Properly unquote PATH_INFO segments intoTraversalRequestNameStack.0.4.2 (2008-06-11)- Deal with Unauthorized exceptions properly: allowRESPONSE._unauthorized to be run and return a value rather thanunconditionally triggering a basic authentication dialog.This version depends on repoze.obob 0.4+.0.4.1 (2008-05-27)- Use view lookup as well as getattr in next_name to detect whethera browser default page actually exists in order to support Zope2.9 "Five.traversable" semantics: getattr alone doesn't work under2.9 to detect whether a default view exists or not.0.4.0 (2008-05-21)- Raise an error Z2BobHelper's map_result method detects that it'sabout to return a value to obob which does not have an __iter__method.  This avoids confusion about what's causing failures whenwe attempt to publish an "unpublishable" object.- Fix a not-true-enough emulation of Zope 2.9 publishing semantics.Symptom: Z3 "adding" views being published without an acquisitionwrapper under Zope 2.9.0.3.9 (2008-05-08)- Instance creation now expands the sandbox path in derived files(e.g. $INSTANCE in zope.conf).- Do not depend on ZODB3 3.7.2.  zopelib ships with a copy of ZODB.This was initially intended as a "convenience upgrade", but let'snot impose it on people.  That said, repoze.retry has a dependencyon a ZODB3 so we'll just wind up with whatever version of ZODB3happens to be in the index being used anyway.- Add a setup.cfg that specifies:[easy_install]index_url = http://dist.repoze.org/zope2/2.10/simpleThis overrides the default PyPI index URL.  Because we removeddependency-links and we don't publish our eggs to PyPI, it isrequired to allow "setup.py test", "setup.py develop", and"setup.py install" to work without the specification of an'--index_url' argument ("test" doesn't even take one).- Do not use a dependency-links= in setup.py.  Instead, trust theindex to provide the right software.- Remove explicit version dependencies from install_requires andtest_requires.  Use whatever versions of the software are in ourindex.- Provide support for Zope 2.9 (previously support was limited toZope 2.10+).- ZServer didn't call app_iter.close after it finished a request asrequired by the WSGI spec (found via Paste#lint).0.3.8 (2008-05-02)- Cause zope2testrunner to sys.exit with a nonzero exit code whenany tests fail (for usage under buildbot).- Filter warnings during addzope2user.0.3.7 (2008-04-18)- "Legacy" (VHM) virtual hosting was broken for virtual host rootsthat contained more than one path element (e.g. /plone/folder).- Overhauled "browser default" handling by moving code out ofbefore_invoke into next_name in the Z2 obob helper.  We now treatbrowser default names such as 'index_html' as just anothertraversal step.- Depend on repoze.vhm 0.6, which re-adds support forpath-segment-based virtual hosting parameters (asegg:repoze.vhm#vhm_path).0.3.6 (2008-04-16)- "http" exceptions (like Redirect and Unauthorized) weren't handledproperly anywhere except in the repoze.zope2 obob helper's'invoke' step.  In-the-wild code uses these exceptions before thepublished object has been located (e.g. during traverse() orbefore_traverse()).  We now depend on repoze.obob >=0.3 to getextended exception handling behavior, and we implement a'handle_exception' method on our z2bob helper which will turnZope2 Unauthorized and Redirect exceptions into their"httpexception" equivalents for consumption by upstreammiddleware.  This was prompted by code found in the wild inPlone's OpenId implementation which raises a redirect duringtraversal.0.3.5 (2008-04-16)- "Legacy" virtual hosting (via Virtual Host Monster) did not workproperly.  Symptom: if you set up proxy-rewrite rules in Apachepointing at the Zope root a repoze.zope2 server running under aseparate paster server, and tried to visit the ZMI via the Apachevirtualhost's /manage URL, you'd be presented with theVirtualHostMonster ZMI configuration page instead of the ZMI'sframed root UI.  Reason: the PARENTS[0] item was not set up earlyenough (it was set up in traverse rather thanbefore_traverse). Since it was depended on by Zope API's which VHMcalled out to to set the virtual root, this didn't work, and theresulting traversal name stack was incorrect.0.3.4 (2008-03-24)- Bump ez_setup.py version.- When Zope 2 starts, it potentially writes data to the databaseduring product initialization.  When multiple clients talk to thesame ZEO storage at startup, they often simultaneously try towrite (the same) information to the database concurrently.  Thiscauses startup failure due to conflict errors.  We now retryproduct initialization up to five times to work around this issue.0.3.3 (2008-03-10)- repoze.zope2 now properly respects virtual host directivesprovided to it by repoze.vhm xheaders middleware >= 0.4.  Zope'sVHM can still be used as necessary, but is no longer required.0.3.2 (2008-03-03)- Fix bug reported by Martin Aspeli: repoze.zope2 would choke onlarge images and files (symptom: broken images when images werelarge).  This was due to the fact that the Zope File- andImage-rendering machinery used HTTPResponse.write, whichrepoze.zope2's response handling didn't handle properly.  We nowsubclass HTTPResponse (as RepozeHTTPResponse) to solve the issue.0.3.1 (2008-03-02)- mkzope2instance now:o takes no arguments, only options.  '-d' replaces the singleargument path.o creates a "log" directoryo writes out a zeo.conf into "etc" (unconditionally); you canstart a ZEO instance after installation now via 'bin/runzeo -Cetc/zeo.conf', after ensuring that the 'address' in the ZEOsection is correct.o allows the specification of 'sandbox' (-s) (replacessingle-argument instancedir), 'zeo-port' (-z) , 'zope-port'(-p), and 'use-zeo' (-z) options.  If 'use-zeo' is specified,the zope.conf that's written will use a ClientStorage bydefault.o writes a zope.conf with a zodb cache-size of 50000 rather than10000.- addzope2user, runzope2script, and debugzope2 now respect a"ZOPE_CONF" environment variable, which can be used to specify thezope.conf configuration file to use.- Add a sample <zodb_db main> section to the generated zope.confthat can be uncommented if the installer wants to use ZEO insteadof FileStorage or vice versa.- Added an (experimental) 'zope2testrunner' script that sets upstuff in the environment before running'zope.testing.testrunner.run'.  It accepts the same arguments asthe Zope 3 testrunner.  E.g. 'bin/zope2testrunner -mProducts.faster'.  This also respects the ZOPE_CONF envvar.- Depend on Zope 2.10.5 (zopelib-2.10.5.0) instead of 2.10.4.2 andvarious other updated repoze libraries.0.3.0- Install a mkzope2instance script as a console script to supportnon-repozeproject based installs.- Change documentation to prefer non-repozeproject installations.0.2.9- Fix up noncompliant WSGI environment server keys (CHANNEL_CREATION_TIME was an integer, QUERY_STRINGdidn't always exist) in "zserver".- Make zope2.wsgi mod_wsgi shim actuallywork (Carlos de la Guardia).0.2.8- Ensure that the REQUEST['URL'] is as computed as possible beforecalling __bobo_traverse__/__getitem__/whatever during traversal tofix a ZMI-related bug.  Symptom: when adding folders or PythonScripts, the redirect back to manage_main would either do nothingor would cause a traceback.- Made setuptools 'description' include CHANGES.txt.0.2.7- Don't make a 'doc' directory, but make an 'import' directoryduring sandbox creation.- During traversal via __bobo_traverse__, turn any KeyError,AttributeError, and zExceptions.NotFound intopaste.httpexceptions.NotFound error.- During traversal via __getattr__, turn AttributeError into apaste.httpexceptions.NotFound error.- During traversal via __getitem__, turn KeyError into apaste.httpexceptions.NotFound error.- Ensure that request['URL'] is not unicode when inserting it intothe body during _insertBaseTag (or it turns the body into unicodetoo, after we've tried to ensure that it's not unicode with atypecheck and cast).- Depend on repoze.errorlog >= 0.4, and cause our default error loghandler to ignore httpexceptions.HTTPNotFound, httpexceptions.HTTPFound,and httpexceptions.Unauthorized.0.2.6- Depend on repoze.errorlog and put it in the default pipeline.Visit '/__error_log__' to see exception history.  We do thisbecause under Repoze, the Zope through-the-web 'error_log'exception history view is always empty.  Use this instead.- Implement WebDAV support.0.2.5- Fix read from RESPONSE.write (it also writes headers).0.2.4- Depend on repoze.vhm >= 0.3.- Allow RESPONSE.write to work (implemented using a temp file).0.2.3- Implement XML-RPC marshalling.- Get maintainer email address right.- Ditch 'python setup.py sandbox' in favor of documentingrepoze.project-based install (see README.txt).0.2.2- Zope2ObobHelper.setup() was URL-quoting the ACTUAL_URL value.  Thiscaused usage of Plone's login portlet to fail (symptom: keyerror on"http:").0.2.1- Add explicit ZODB3 requirement (>= 3.7.2, < 3.8.0a1), because repoze.tmand repoze.retry have relaxed their requirements, and might thereforebring in a ZODB incompatible with our zopelib version.0.2- Use repoze.obob 0.2 publishing semantics in order to be able tocontinue respecting 'TraversalRequestNameStack' (CMF modifies thisstack in before-traversal hooks in CMFDynamicType).  This fixesPlone/CMF (symptoms: Plone front page not shown properly; 'edit'link for front page pointed to portal instead of default front-pagecontent).- Close the ZPublisher HTTPRequest at obob "teardown" time.  Thisappears to fix a problem where CMF skin method names could not befound while running CMF and Plone Symptom: transient andintermittent AttributeError, NotFound error, or KeyError whenattempting to render a page which used skins when running under thePaste http, PasteScript wsgiutils, or repoze.zope2.server WSGIservers.  Under mod_wsgi, this symptom was never evident.- Allowed the number of threads to be configurable in therepoze.zope2.server WSGI server (threads option in server configsection).0.1Initial release.