GithubHelp home page GithubHelp logo

zopefoundation / zope Goto Github PK

View Code? Open in Web Editor NEW
352.0 91.0 98.0 159.96 MB

Zope is an open-source web application server.

Home Page: https://zope.readthedocs.io

License: Other

Python 91.74% CSS 6.48% HTML 1.30% JavaScript 0.48%
python application-server web wsgi python-3-only maintained

zope's Introduction

https://coveralls.io/repos/github/zopefoundation/Zope/badge.svg?branch=master Documentation Status Current version on PyPI Supported Python versions

 

Zope logo

Zope is an open-source web application server.

This document provides some general information about Zope and provides links to other documents. The full documentation can be found at https://zope.readthedocs.io.

Please visit the installation documentation at https://zope.readthedocs.io/en/latest/INSTALL.html for detailed installation guidance.

Zope is licensed under the OSI-approved Zope Public License (ZPL), version 2.1. The full license text is included in LICENSE.txt.

Bugs reports should be made through the Zope bugtracker at https://github.com/zopefoundation/Zope/issues. A bug report should contain detailed information about how to reproduce the bug.

zope's People

Contributors

baijum avatar caseman avatar cjw296 avatar d-maurer avatar dataflake avatar davisagli avatar drfho avatar dwt avatar freddrake avatar gotcha avatar gvanrossum avatar hannosch avatar hathawsh avatar jshell avatar jugmac00 avatar kenmanheimer avatar latteier avatar mauritsvanrees avatar mcdonc avatar petrilli avatar philikon avatar regebro avatar sallner avatar sidnei avatar slinkp avatar stefanholek avatar tseaver avatar warsaw avatar wichert avatar zopyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zope's Issues

Zope2 2.13.22 not installable

hi all

INSTALL.rst refers to bootstrap/bootstrap.py, which is not present.

download.zope.org seems to be deprecated now (no subdirectory for current version 2.13.22).

easy_install Zope2-2.13.22.zip gives me this error when starting Zope: zopefoundation/zope.pagetemplate#1

How am I supposed to install Zope2 2.13.22 (preferrably with easy_install)?

Regards,

Michael Brunnbauer

Zope Crashes with Segmentation Fault (Zope 2.13.22-24, Python 2.7.11)

I am attempting to roll out a new Zope on Ubuntu 16.04 LTS by performing a virtualenv installation from scratch. I create an instance with "mkzopeinstance", setting the user and password to "admin".

The following test leads to a segmentation fault after only 10 iterations:

`#!/bin/bash
set -e

urls="
http://admin:admin@localhost:8080/Control_Panel/manage_main
http://admin:admin@localhost:8080/Control_Panel/Database/main/manage_main
http://admin:admin@localhost:8080/Control_Panel/Database/manage_main
http://admin:admin@localhost:8080/Control_Panel/Database/main/manage_activity
http://admin:admin@localhost:8080/manage
http://admin:admin@localhost:8080/acl_users/manage_main
http://admin:admin@localhost:8080/acl_users/manage_access
"

while true ; do
for url in ${urls} ; do
echo ${url}
curl -s $url -o /dev/null
done
done
`

The same can be replicated by cloning master, performing a buildout and creating a fresh instance as described above.

For all tests, python 2.7.11 was used (as distributed with Ubuntu 16.04LTS).

The test does not fail in a buildout of Zope 2.13.22 with python 2.7.8 (as distributed with Ubuntu 14.04LTS).

Can anybody point me to a method of detecting the source of the problem? Has anybody successfully deployed Zope with python 2.7.11 yet?

If I can help describing the problem more in details, please contact me.

Extrange error

Cleaning and messing with my requirements, I've ended with that error:

Site Error

An error was encountered while publishing this resource.

Error Type: TypeError
Error Value: unbound method __new__() must be called with r instance as first argument (got ExtensionClass instance instead)

When trying to execute a ZSQLMethod. Any ideas what's wrong:

AccessControl==3.0.13
Products.Sessions==3.0
Zope2==2.13.26
Products.BTreeFolder2==2.13
Products.ZCTextIndex==2.13
Products.MailHost==2.13
Products.OFSP==3.0
Products.ZSQLMethods==2.13
Products.ExternalMethod==2.13
Products.PythonScripts==2.13
Products.CMFCore==2.2.10
ZopeUndo==2.12
python-gettext
z3c.sqlalchemy
DBUtils==1.1
psycopg2
googleads==4.2.0
google-api-python-client==1.5.3
ipython==5.3
pycrypto==2.6
SOAPpy==0.12.22
reportlab==2.6
requests==2.12.3
GeoIP==1.3.2
mechanize==0.2.5
redis
hiredis
watchdog==0.8.3
python-memcached


Python 3 compatibility

According to caniusepython3 the following packages need some love to get Python 3 support:

Optional dependencies:

Zope itself:

  • Zope

WebDAV PROPFIND response violates XML-Namespace

Zope2 2.13.19

Issuing a WebDAV "PROPFIND" againt a Plone "Folder", I got a response
violationg XML-Namespace:

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/partner/bp3/test/</d:href>
<d:propstat xmlns:n="http://www.zope.org/propsets/default">
  <d:prop>
  <n:title>Test</n:title>
  </d:prop>
  <d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat xmlns:n="DAV:">
  <d:prop>
  <n:creationdate>1970-01-01T12:00:00Z</n:creationdate>
 ...
  </d:prop>
  ...
</d:propstat>
</d:response>
...
</d:multistatus>

The namespace prefix inside the second "propstat" is not defined.

Zope 4 WSGIPublisher: exception views are rendered outside of pubevents

Currently the WSGIPublisher first publishes the request running within the transaction_pubevents context manager, then catches any exception and tries to render an exception view. This makes for some regressions compared to how exception views used to work:

  1. The PubBeforeAbort event is not called after the exception view produces a response. (This is one place where plone.transformchain hooks in, so it means that Diazo themes are not applied to exception view responses.)
  2. The PubFailure event is called before the exception view is rendered, which means that the request is no longer registered as active with zope.globalrequest.

I'm thinking maybe rendering exception views actually belongs within the publish function.

WebDAV: bad charset handling in "PROPPATCH"

Zope2 2.13.10

I send the following "PROPPATCH" command to a Plone object (which uses
"utf-8" as charset for its properties):

<propertyupdate xmlns='DAV:'>\n  <set><prop><title
xmlns='http://www.zope.org/propsets/default'>k\xc3\xa4lander.xml</title></prop></set>\n</propertyupdate>

In "webdav.xmltools.Node.strval" the incoming property value
u"kälander.xml" in encoded in a so called "zope_encoding", defined as
"latin-1". At least for properties of Plone objects, this is the wrong
encoding.

Zope2 4.x does not provide XML-RPC folder listings

I create a BTreeFolder2 named "folder". Then I do this:

Python 2.7.12 (default, Sep  2 2016, 14:46:00) 
[GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> s = xmlrpclib.Server("http://localhost:8080/")
>>> s.folder.objectIds()

This happens:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1331, in single_request
    response.msg,
xmlrpclib.ProtocolError: <ProtocolError for localhost:8080/: 404 Not Found>

This used to work. What happened?

Possibly clean up connection open/close logic

Right now Zope opens a ZODB connection while traversing over the application root object (https://github.com/zopefoundation/Zope/blob/master/src/App/ZApplication.py) via a ZApplicationWrapper. The ZApplicationWrapper is set up during app startup in https://github.com/zopefoundation/Zope/blob/master/src/Zope2/App/startup.py#L126

This wrapper opens the connection and than adds a Cleanup instance to the request instance _held attribute. This cleanup instance has a handle on the ZODB connection (_p_jar). While closing the request, the request's clear method is called (https://github.com/zopefoundation/Zope/blob/master/src/ZPublisher/BaseRequest.py#L219), which sets _held to None. This in turn causes the ZApplication.Cleanup.__del__ to be called, which in turn aborts any still open transaction and closes the connection (_p_jar.close()).

I think that at least the connection open/close logic should be moved into the publisher as a context manager or try/finally block. The current logic is awkward to say the least and stems from a time when neither try/finally nor context managers where available.

from zope.pagetemplate.pagetemplate import _error_start, PTRuntimeError ImportError: cannot import name _error_start

I quiet new to Zope and I have been trying to install Zope 2.13.22 on a windows machine with Python 2.7 following the instructions; http://docs.zope.org/zope2/releases/2.13/INSTALL.html, I followed them religiously, managed to the create the virtual environment and installed Zope to the virtual environment, I then created an instance of Zope, but my trouble is each time I try to run zope using the zopectl fg, I get the error below;

Traceback (most recent call last):
File "D:\ZopeEnv2\Scripts\runzope-script.py", line 9, in
load_entry_point('zope2==2.13.22', 'console_scripts', 'runzope')()
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Zope2\Startup\run
py", line 22, in run
starter.prepare()
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Zope2\Startup__i
it__.py", line 86, in prepare
self.startZope()
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Zope2\Startup__i
it__.py", line 262, in startZope
Zope2.startup()
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Zope2__init__.py
, line 46, in startup
from Zope2.App.startup import startup as _startup
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Zope2\App\startup
py", line 38, in
import OFS.Application
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\OFS\Application.p
", line 29, in
from App.ApplicationManager import ApplicationManager
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\App\ApplicationMa
ager.py", line 39, in
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Products\PageTemp
ates\PageTemplateFile.py", line 30, in
from Products.PageTemplates.PageTemplate import PageTemplate
File "D:\ZopeEnv2\lib\site-packages\zope2-2.13.22-py2.7.egg\Products\PageTemp
ates\PageTemplate.py", line 19, in
from zope.pagetemplate.pagetemplate import _error_start, PTRuntimeError
ImportError: cannot import name _error_start

I found a similar issue I found another similar here zopefoundation/zope.pagetemplate#1 , I tried downgrading zope.pagetemplate to v3.5.2 from v4 as advised in the post but this just added more misery and received the following error;
"error in zope.pagetemplate setup command: Distribution contains no modules or p
ckages for namespace package 'zope'"

As I mentioned I am quiet new at this and will appreciate any help...
Thanks

Document WSGI deployment

I've tried to update and document a WSGI deployment with modern versions of the stack, but failed so far.

I've added a new runwsgi script (basic copy of Pyramid's pserve, to avoid PasteScript) in 72ae9a1. I also updated the default mkzopeinstance skeleton to create WSGI config files by default (9ac28c1).

So in a buildout checkout you can currently do:

bin/mkzopeinstance -d .
bin/runwsgi -v etc/zope.ini

And get a paste#http based server with repoze.tm2 set up. I tried using waitress instead, but it immediately complains about WSGI requests not supporting hop-by-hop headers. I'm guessing that's related to the "Connection" header we emit, but didn't dig in further.

I tried adding repoze.retry, but doing so results in AssertionError: app must call start_response before returning.

Currently any exceptions, for example NotFound are also not rendered as HTML back to the client, but only show up on the console. I tried WebError and paste:httpexceptions without luck.

Help or advice welcome.

IUnboundStreamIterator does not work

In one if the recent Zope2 version IUnboundStreamIterator was introduced.
Unfortunately it is not fully working when the WSGIPublisher is used. In the WSGIPublisher there is still this line.

if isinstance(body, file) or IStreamIterator.providedBy(body): 

However when body is IUnboundStreamIterator, the check is always 'False'.
So I would change this line to the following code:

if isinstance(body, file) or IUnboundStreamIterator.providedBy(body):

The class hirachy is like this:
IUnboundIt -> IStreamIt
so the check is 'True' for both types.

@gweis as the implementer of this feature, what do you think ?

Icons missing from ZMI

I started working on and old zope codebase ( 2.13.19 ) and managed to update it to 2.13.24.
Tried with newer versions without luck. ( I think that with 2.13.25 when boot I have conflicts with Product.Sessions). But also, with 2.13.24 I miss the folder icons from the ZMI (any ideas how I can fix it)

ZTUtils.Zope make_query cannot handle unicode

The way we created this issue:

Use unicode in a search string
use PloneBatch to batch search results
Try using PloneBatch's to generate the pagnation links.

Answer:
Module ZTUtils.Zope, line 186, in make_query
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

qlist[i] = '%s%s=%s' % (uq(k), m, uq(str(v)))

v is unicode.

The Zope query string marshaling already defines how to injest utf8 values from the query string. It only makes sense that what we can marshal from a query string can round-trip back into a query string via make_query()

#78 Fixes this

Remove sourcecodegen dependency

For Zope 4 the code from five.pt got integrated directly into Products.PageTemplates.

As part of this a new dependency on sourcecodegen got added. This is only used in Products.PageTemplates.expression.UntrustedPythonExpr.parse (https://github.com/zopefoundation/Zope/blob/master/src/Products/PageTemplates/expression.py#L173).

That method also uses from compiler import parse as ast24_parse.

I think both of those should no longer be needed, as they are backwards compatibility for old Python versions, so they should be replaced with something more modern. Zope 4 only supports Python 2.7 at this point.

@malthe Do you remember off-hand what it takes to get rid of the old AST code here?

RestrictedDTMLMixin.__new__(Rtd) is not safe, use TemplateDict.__new__()

I am currently porting a Zope 2.7 application to Zope 2.13.

I receive the following error while rendering some persistent ZPTs... how to deal with that?

2017-01-04 13:15:13 ERROR Zope.SiteErrorLog 1483532113.350.552179133409 http://10.162.62.85:12080/error_log/manage_main
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 130, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: manage_main
   - Line 1, Column 0
   - Expression: <PathExpr standard:'context/manage_page_header'>
   - Names:
      {'container': <SiteErrorLog at /error_log>,
       'context': <SiteErrorLog at /error_log>,
       'default': <object object at 0x30026b58>,
       'here': <SiteErrorLog at /error_log>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x315f5dc4>,
       'request': <HTTPRequest, URL=http://10.162.62.85:12080/error_log/manage_main>,
       'root': <Application at >,
       'template': <PageTemplateFile at /error_log/main>,
       'user': <User 'aj'>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module Products.PageTemplates.Expressions, line 105, in render
  Module Products.PageTemplates.ZRPythonExpr, line 67, in call_with_ns
TypeError: RestrictedDTMLMixin.__new__(Rtd) is not safe, use TemplateDict.__new__()
0Suchvorgang...

zexp imports can raise unnecessary exceptions

User problem

Import a zexp and get an exception originating in an objectEventNotify subscriber.

history

zexp calls the copy event handlers for every single object. This is both slow and error prone and in a lot of cases doesn't make sense. Sometimes problems are caused because the order the events are called is not expected by the code.

options

  1. Have a tickbox that allows the user to optionally suppress all objectEventNotify events during import.
  2. never call objectEventNotify?
  3. introduce so new import event?

Remove more non-Chameleon parts of Products.PageTemplates

Zope master uses and sets up Chameleon as the default ZPT rendering engine. To do this, I've integrated the former five.pt code directly into Products.PageTemplates.

But I didn't yet remove the older code that is no longer required for Chameleon. One issue here is that Chameleon hooks itself into zope.pagetemplate via a utility registration for IPageTemplateEngine. This means you need to have ZCML set up for this to work. The old PageTemplates logic didn't require any ZCML. As a result tests without a ZCML layer or those not loading Products.PageTemplates configure.zcml still use the old ZPT engine.

One module that should probably be deprecated and cleaned out is Expressions (https://github.com/zopefoundation/Zope/blob/master/src/Products/PageTemplates/Expressions.py). In it the old module scope _engine is created.

The newer Chameleon integration code is in expression.py and engine.py.

Plone 4.3.7 fails to start if a zoperunner is configured

Due to this commit 08b0e95
if I have a runner configured such as:

zope-conf-additional =
  
      socket-name ${buildout:directory}/var/zopectlsock-${:_buildout_section_name_}
     

Then if I attempt to start Plone I get the following error:

eggs/zdaemon-2.0.7-py2.7.egg/zdaemon/zdoptions.py", line 308, in realize
    obj = getattr(obj, part)
AttributeError: SectionValue instance has no attribute 'start_timeout'

The fix that I have figured and I think is proper is to add the following snippet to
zopeschema.xml of Zope2/Startup/zopeschema.xml

<key name="start-timeout" datatype="integer" required="no"
     default="300">
  <description>
    When a start-test-program is supplied, a process won't be
    considered to be started until the test program exits normally
    or until start-timout seconds have passed.

    This defaults to 300 seconds (5 minutes).
  </description>
</key>

Adding a newer version of zdaemon makes no difference even though it adds a start-timeout
option as well. I actually got this key option from zdaemon-4.1.0 and unfortunately zopeschema.xml
needs this key as well since zope.runner now has this new option.

Due to this fix being part of Zope foundation I am not submitting a pull request but I am adding this issue detailing how to fix hoping that this could be added by a core committer.

Enhance docs to explain how to create a Zope2 app

The docs at readthedocs.io basically only mention how to get Zope2 to work, but nothing else.

They do not mention what to learn / know / how to write an egg that I can load in Zope2 and have it work, say, as an addable content type, or as a view registration, or as a traversal adapter, and so on, and so forth.

I propose that the documentation gain that information, or pointers to where that information may be obtained.

Form-value gets turned into a request-record instead of a dict

Form-value gets turned into a request-record instead of a dict

A doctest with a item

<input type="checkbox" value="1" name="index.enabled:records" id="created_enabled" checked="checked" />

fails in Zope 4 since index is transformed to a ZPublisher.HTTPRequest.record instance.

In the button-handler the value is gotten from the rest and checked for some value:

data = REQUEST.get('index', [])
for index in data:
    enabled = 'enabled' in index

The last line results in "KeyError: 0" since data is a list of ZPublisher.HTTPRequest.record instances which calls self.__dict__[key] on __getitem__.

I fixed the respective code using enabled = 'enabled' in index.keys() in plone/Products.ATContentTypes#41 and the feature in which this happened is deprecated anyway. But there might be a issue with processInputs in HTTPRequest (or a issue with the form itself).

HEAD requests raise AttributeError on browser views

I keep seeing on our server logs errors like the following:

Traceback (innermost last):
  Module ZPublisher.Publish, line 127, in publish
  Module ZPublisher.BaseRequest, line 384, in traverse
AttributeError: @@RSS

And indeed, a request like curl -I https://www.freitag.de/@@RSS gives an error (modulo when Varnish caches something).

The problem seems to be that ZPublisher.BaseRequest assumes that everything that is not GET, POST or PURGE will be a webDAV request and thus tries to find an object, which a view of course is not.

This happens on Zope 2.13.22 but master has the same code on traverse so I guess it applies also there.

Zope on shell commands

Tying to build some scripts for a zope.. Found a way to execute them (taken from plone repos) with app "context", something like:

from Zope2 import configure
configure(configfile)
app = Zope2.app()

The thing is that all is working if you pass to the script a parameter (not a positional). After digging on the source, found that all is related to configure, tied to zdaemon.zdoptions import ZDOptions. And that, made me thing that I'm not doing it the proper way, or something is wrong, because, seems that ZDOptions is parsing again sys.args and firing and exeption if there are positional arguments (Thanks pdb) (Currently I'm on 2.13.24 release)

Seems that parts of that code are refactored.. on newer releases. Any hints? What is doing configure that can't not be done manually?

https://github.com/search?p=2&q=configure%28configfile%29+app+%3D+Zope2.app%28%29&type=Code&utf8=%E2%9C%93

DB Connections are never released if an EndRequestEvent subscriber raises an exception

We have a Plone platform with a number of ZODB mounts and recently started noticing some significant memory issues with our instances. Each of our instances currently has one zserver-thread, but for some reason multiple DB connections were being created, resulting in memory use going up and up.

Eventually we tracked it down to a bug in collective.linkcheck, which is raising an Exception during an EndRequestEvent subscriber. Although we've stopped using the product for now, Zope should possibly handle this situation better.

The problem is reproducible with a basic event subscriber:

<subscriber
      for="zope.publisher.interfaces.IEndRequestEvent"
      handler=".events.test_end_request"
      />
def test_end_request(event):
    raise Exception

A BaseRequest "holds" a number of objects, including the DB Connection. When a BaseRequest is closed, the EndRequestEvent is notified and the Request is then cleared, releasing the Connection (allowing it to be closed/released back to the pool) and any other objects that have been held.

https://github.com/zopefoundation/Zope/blob/master/src/ZPublisher/BaseRequest.py#L218

If an Exception is raised in an EndRequestEvent subscriber, the Request is never cleared. The DB Connection and other objects are held forever.

The Request should release these objects even if an Exception has been raised.

PropertyManager - You can set a float in an int property using manage_changeProperties

https://github.com/zopefoundation/Zope/blob/master/src/OFS/PropertyManager.py#L203

This line has a test regarding strings but there is nothing dealing with other types.

Recreate:
Go to an objects property tab.
Create an into property on the object (say blah).
Create a Script (Python) and add into it (replace obj with the actual object of course):
obj.manage_changeProperties(blah=0.5)
Run the script and reload the properties tab.
The properties tab of the object will display 0.5 but of course will not save because of ":int" in the name field of the input box.

Not sure if this is an issue in newer zopes (like 3).

OFS.ObjectManager.__contains__ optimisation conflicts with catalog

I am trying this on the Plone 5.0 development buildout. It is using Zope2 2.13.24. Instead I checked out Zope2 branch 2.13 and this resulted in a few failures on our Jenkins test server: http://jenkins.plone.org/job/plone-5.0-python-2.7/4932/
I focused on the plone.app.folder one:
http://jenkins.plone.org/job/plone-5.0-python-2.7/4932/testReport/junit/plone.app.folder.tests.test_integration/FolderReplacementTests/testGetObjPositionInParentIndex/

That can be seen in a debug session too:

$bin/instance debug
>>> 'getObjPositionInParent' in app.Plone.portal_catalog.indexes()
True
>>> app.Plone.portal_catalog.Indexes['getObjPositionInParent']
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/maurits/community/plone-coredev/5.0/src/Zope2/src/OFS/ObjectManager.py", line 784, in __getitem__
    raise KeyError, key
KeyError: 'getObjPositionInParent'

With Zope2 tag 2.13.24 this error goes away.
The breaking point is with the merge of pull request #62.

KeyError: bobobase_modification_time

Adding and running a Script (Python) on Zope master results in this traceback:

Traceback (innermost last):

Module ZServer.ZPublisher.Publish, line 149, in publish
Module ZPublisher.mapply, line 89, in mapply
Module ZServer.ZPublisher.Publish, line 47, in call_object
Module Shared.DC.Scripts.Bindings, line 324, in __call__
Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
Module App.special_dtml, line 204, in _exec
Module DocumentTemplate._DocumentTemplate, line 144, in render_blocks
Module DocumentTemplate._DocumentTemplate, line 245, in render_blocks_
Module DocumentTemplate.DT_Var, line 231, in render
KeyError: 'bobobase_modification_time'

bobobase_modification_time was removed (it was monkeypatched onto Persistent in a weird way) so probably DocumentTemplate needs to be adjusted to not use it.

Registering an exception view for zExceptions.Unauthorized not possible in Zope 4

Unlike Zope 2.13 (tested with Zope 2.13.26) Zope 4 disregards views registered for zExceptions.Unauthorized. This is used in e.g. CMFDefault to redirect users to the CMF login page.

For reference, here's the relevant code in Products.CMFDefault:

View registration https://github.com/zopefoundation/Products.CMFDefault/blob/master/Products/CMFDefault/browser/membership/configure.zcml#L39

View class https://github.com/zopefoundation/Products.CMFDefault/blob/master/Products/CMFDefault/browser/membership/authentication.py#L63

The view class raises zExceptions.Redirect if certain conditions are met.

Make RestrictedPython optional

In the first step this should be a proof of concept for a Zope without RestrictedPython.

  • TTW code should raise an exception when called without RestrictedPython available
  • File system code should use the normal Python (aka without restrictions)
  • Implement an actual example e. g. in AccessControl and Products.PythonScripts

ipv6 tests fail on Travis

Zope job 102 from three months ago ran on the legacy Travis structure and passed fine:
https://travis-ci.org/zopefoundation/Zope/jobs/90092264

Two builds from the past few days have this message in Travis: "This job ran on our new platform for Precise builds. Please read our blog post for more information." Follow the link and one of the things you read is: "The major change that is coming with this migration is that local and external IPv6 networking will no longer be present."

And indeed those two recent builds fail with this error:

Error in test test_http_over_ipv6 (ZServer.tests.test_config.ZServerConfigurationTestCase)
Traceback (most recent call last):
  File "/opt/python/2.7.9/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/home/travis/build/zopefoundation/Zope/src/ZServer/tests/test_config.py", line 148, in test_http_over_ipv6
    server = factory.create()
  File "/home/travis/build/zopefoundation/Zope/src/ZServer/datatypes.py", line 88, in create
    logger_object=access_logger)
  File "/home/travis/build/zopefoundation/Zope/src/ZServer/HTTPServer.py", line 449, in __init__
    http_server.__init__(self, ip, port, resolver, logger_object)
  File "/home/travis/build/zopefoundation/Zope/src/ZServer/medusa/http_server.py", line 574, in __init__
    self.bind ((ip, port))
  File "/opt/python/2.7.9/lib/python2.7/asyncore.py", line 342, in bind
    return self.socket.bind(addr)
  File "/opt/python/2.7.9/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

I wondered if the container based setup supports ipv6, but no, they do not:
https://docs.travis-ci.com/user/ci-environment/#Networking

So i guess we should allow this test to fail...

Issues with chained assignments for func_code / __code__

In several places that used to define func_code, a chained assignment has been inserted to make both func_code and code available. Example:

https://github.com/zopefoundation/Zope/blob/master/src/Products/PageTemplates/ZopePageTemplate.py#L81

This chained assignment does not work correctly and several Products.CMFDefault tests now fail with the end of the traceback showing...

  File "/Users/jens/src/Products.CMFDefault/src/Zope2/src/ZPublisher/mapply.py", line 55, in mapply
    names = code.co_varnames[count:code.co_argcount]
AttributeError: 'NoneType' object has no attribute 'co_varnames'

In the referenced code, "code" is the __code__ attribute of a FSPageTemplate and it is None at that place. However, the FSPageTemplate's attribute func_code is properly set up. If I change ZopePageTemplate.py and do a simple assignment to __code__ while dropping the assignment to func_code the tests work again.

installed manually zope

Hello, I am from China. I saw Zope with zc.buildout Installing. Because of the network line problem, I can not be installed through the network, can only be installed manually. After installation, did not download the file package.

Now, I don't have ‘bin/buildout’ in the directory. And there is no ‘bin/mkzopeinstancein’ this directory。There is no way to solve this? Can provide manual installation of the complete file ?

Waiting for your reply。
If you can, please contact me via email.my E-mail is [email protected]

Security tab permission / role matrix security issue

There's a security issue hidden in the "Security" tab of zope. Administrators change permissions by selecting checkboxes in the permission / role matrix. The underlying form uses column and row numbers in its request. If somebody manages to change the number of available permissions while the administrator has not yet saved the changes there's a problem: permissions would not match up any more.
I've solved this by introducing hashes instead of numbers. Initially I thought I could use permission ids, but they may contain blanks. Hashes make sure that just every permission name will work.
The changes went into OFS and AccessControl.

WSGI deployment documentation

Recently Zope WSGI publishing seems to get some love. Is there any documentation around how to setup a Zope with WSGI? Are there any best practises or example configuration?

'mkzopeinstance' is b0rken on Python3

$ /opt/Python-3.6.0/bin/virtualenv /tmp/z2py36
...
$ cd /tmp/z2py36
$ bin/pip install -U setuptools pip wheel
...
$ bin/pip install -r http://zopefoundation.github.io/Zope/releases/4.0a6/requirements-full.txt
...
$ bin/mkzopeinstance -d var -u $LOGIN:$PASSWORD
Traceback (most recent call last):
  File "bin/mkzopeinstance", line 7, in <module>
    from ZServer.Zope2.utilities.mkzopeinstance import main
  File "/tmp/z2py36/lib/python3.6/site-packages/ZServer/__init__.py", line 71, in <module>
    utils.patchSyslogServiceName()
  File "/tmp/z2py36/lib/python3.6/site-packages/ZServer/utils.py", line 72, in patchSyslogServiceName
    from medusa import logger
ModuleNotFoundError: No module named 'medusa'

New release?

All current released Zope eggs won't install as dependency under Python3 because of the sourcecodegen dependency:

File "/var/folders/jq/51f_s8vs5wz2hjlvrx0b9qhh0000gn/T/easy_install-r5qaeefn/sourcecodegen-0.6.14/ez_setup.py", line 94
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax

The dependency is gone in master for several days now. Can you make a new alpha release please?

WebDAV support

Zope2 2.x used to have WebDAV support. Zope2 4.x ships by default with waitress instead, and that only does plain HTTP.

What are my options if I want to use Zope2 4.x to copy files to / from the Zope application running on my server?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.