Skip to content

Commit

Permalink
Merge branch 'master' into prepare-zope-5
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Sep 4, 2019
2 parents 89fff4c + 46e0ef0 commit 0e2b69d
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 78 deletions.
16 changes: 1 addition & 15 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst


5.0a1 (unreleased)
------------------
-----------------

Backwards incompatible changes
++++++++++++++++++++++++++++++
Expand All @@ -16,21 +16,7 @@ Backwards incompatible changes
If you are still running on Python 2.7 upgrade to the latest Zope 4 version
first, migrate to Python 3 and than switch to Zope 5.


Features
++++++++

- Resurrect History ZMI tab and functionality

Other changes
+++++++++++++

- Update to current releases of the dependencies.

- Removed commented out configuration for tempstorage (and server side
sessions) as that was known not working for ages. This was removed so we do
not lead unsuspecting developers to think that this is the right way to do
session data. See
(`#679 <https://github.com/zopefoundation/Zope/issues/679>`_)
(`tempstorage#8 <https://github.com/zopefoundation/tempstorage/issues/8>`_)
(`tempstorage#12 <https://github.com/zopefoundation/tempstorage/issues/12>`_)
1 change: 0 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ parts =
requirements
sources-dir = develop
auto-checkout =
AccessControl

[testenv]
PYTHONHASHSEED = random
Expand Down
14 changes: 7 additions & 7 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AccessControl==4.0
AccessControl==4.1
Acquisition==4.6
AuthEncoding==4.1
BTrees==4.6.0
Expand All @@ -8,20 +8,20 @@ DocumentTemplate==3.1b2
ExtensionClass==4.4
Missing==4.1
MultiMapping==4.1
Paste==3.1.0
Paste==3.1.1
PasteDeploy==2.0.1
Persistence==3.0
Products.BTreeFolder2==4.2
Products.ZCatalog==5.0.1
Record==3.5
RestrictedPython==4.0
RestrictedPython==5.0
WSGIProxy2==0.4.6
WebOb==1.8.5
WebTest==2.0.33
ZConfig==3.5.0
ZEO==5.2.1
ZODB==5.5.1
ZServer==4.0.1 ; python_version < '3.0'
ZServer==4.0.2 ; python_version < '3.0'
Zope2==4.0
five.globalrequest==99.1
five.localsitemanager==3.2.2
Expand All @@ -36,10 +36,10 @@ roman==3.2
shutilwhich==1.1.0
six==1.12.0
transaction==2.4.0
waitress==1.3.0
waitress==1.3.1
z3c.pt==3.2.0
zExceptions==4.1
zc.lockfile==1.4
zc.lockfile==2.0
zdaemon==4.3
zodbpickle==1.0.4
zope.annotation==4.7.0
Expand Down Expand Up @@ -73,7 +73,7 @@ zope.pagetemplate==4.4.1
zope.processlifetime==2.3.0
zope.proxy==4.3.2
zope.ptresource==4.2.0
zope.publisher==5.1.0
zope.publisher==5.1.1
zope.ramcache==2.3
zope.schema==4.9.3
zope.security==4.3.1
Expand Down
12 changes: 6 additions & 6 deletions requirements-full.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope
AccessControl==4.0
AccessControl==4.1
Acquisition==4.6
AuthEncoding==4.1
BTrees==4.6.0
Expand All @@ -9,13 +9,13 @@ DocumentTemplate==3.1b2
ExtensionClass==4.4
Missing==4.1
MultiMapping==4.1
Paste==3.1.0
Paste==3.1.1
PasteDeploy==2.0.1
Persistence==3.0
Products.BTreeFolder2==4.2
Products.ZCatalog==5.0.1
Record==3.5
RestrictedPython==4.0
RestrictedPython==5.0
WSGIProxy2==0.4.6
WebOb==1.8.5
WebTest==2.0.33
Expand All @@ -36,10 +36,10 @@ roman==3.2
shutilwhich==1.1.0
six==1.12.0
transaction==2.4.0
waitress==1.3.0
waitress==1.3.1
z3c.pt==3.2.0
zExceptions==4.1
zc.lockfile==1.4
zc.lockfile==2.0
zdaemon==4.3
zodbpickle==1.0.4
zope.annotation==4.7.0
Expand Down Expand Up @@ -73,7 +73,7 @@ zope.pagetemplate==4.4.1
zope.processlifetime==2.3.0
zope.proxy==4.3.2
zope.ptresource==4.2.0
zope.publisher==5.1.0
zope.publisher==5.1.1
zope.ramcache==2.3
zope.schema==4.9.3
zope.security==4.3.1
Expand Down
2 changes: 1 addition & 1 deletion src/Products/Five/component/makesite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Create the test browser we'll be using:

>>> from Testing.testbrowser import Browser
>>> browser = Browser()
>>> browser.addHeader('Authorization', 'Basic manager:r00t')
>>> browser.login('manager', 'r00t')

Let's add a folder:

Expand Down
6 changes: 4 additions & 2 deletions src/Products/SiteAccess/VirtualHostMonster.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
from OFS.SimpleItem import Item
from Persistence import Persistent
from zExceptions import BadRequest
from zope.publisher.http import splitport
from ZPublisher.BaseRequest import quote
from ZPublisher.BeforeTraverse import NameCaller
from ZPublisher.BeforeTraverse import queryBeforeTraverse
from ZPublisher.BeforeTraverse import registerBeforeTraverse
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse
from ZPublisher.HTTPRequest import splitport


class VirtualHostMonster(Persistent, Item, Implicit):
Expand Down Expand Up @@ -149,7 +149,9 @@ def __call__(self, client, request, response=None):
stack.pop()
protocol = stack.pop()
host = stack.pop()
request.setServerURL(protocol, *splitport(host))
hostname, port = splitport(host)
port = int(port) if port else None
request.setServerURL(protocol, hostname, port)
path = list(stack)

# Find and convert VirtualHostRoot directive
Expand Down
6 changes: 1 addition & 5 deletions src/ZPublisher/BaseRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,7 @@ def traverse(self, path, response=None, validated_hook=None):

if inext is not None:
i = inext

if hasattr(groups, 'validate'):
v = groups.validate
else:
v = old_validation
v = getattr(groups, 'validate', old_validation)

auth = request._auth

Expand Down
22 changes: 1 addition & 21 deletions src/ZPublisher/HTTPRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from zope.interface import directlyProvides
from zope.interface import implementer
from zope.publisher.base import DebugFlags
from zope.publisher.http import splitport
from zope.publisher.interfaces.browser import IBrowserRequest
from ZPublisher import xmlrpc
from ZPublisher.BaseRequest import BaseRequest
Expand Down Expand Up @@ -107,27 +108,6 @@ class NestedLoopExit(Exception):
pass


def splitport(url):
"""Return (hostname, port) from a URL
If it does not return a port, return the URL unchanged.
This mimics the behavior of the `splitport` function which was
in Python and got deprecated in Python 3.8.
"""
parsed = urlparse(url)
if (not parsed.scheme
and parsed.port is None
and parsed.hostname is None):
# urlparse does not like URLs without a protocol, so add one:
parsed = urlparse('http://{}'.format(url))
if parsed.port is None:
return url, None
hostname = parsed.hostname
if parsed.netloc.startswith('['):
hostname = "[{}]".format(hostname)
return hostname, parsed.port


@implementer(IBrowserRequest)
class HTTPRequest(BaseRequest):
""" Model HTTP request data.
Expand Down
14 changes: 7 additions & 7 deletions versions-prod.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[versions]
Zope =
Zope2 = 4.0
AccessControl = 4.0
AccessControl = 4.1
Acquisition = 4.6
AuthEncoding = 4.1
BTrees = 4.6.0
Expand All @@ -14,20 +14,20 @@ DocumentTemplate = 3.1b2
ExtensionClass = 4.4
Missing = 4.1
MultiMapping = 4.1
Paste = 3.1.0
Paste = 3.1.1
PasteDeploy = 2.0.1
Persistence = 3.0
Products.BTreeFolder2 = 4.2
Products.ZCatalog = 5.0.1
Record = 3.5
RestrictedPython = 4.0
RestrictedPython = 5.0
WSGIProxy2 = 0.4.6
WebOb = 1.8.5
WebTest = 2.0.33
ZConfig = 3.5.0
ZEO = 5.2.1
ZODB = 5.5.1
ZServer = 4.0.1
ZServer = 4.0.2
five.globalrequest = 99.1
five.localsitemanager = 3.2.2
funcsigs = 1.0.2
Expand All @@ -41,10 +41,10 @@ roman = 3.2
shutilwhich = 1.1.0
six = 1.12.0
transaction = 2.4.0
waitress = 1.3.0
waitress = 1.3.1
z3c.pt = 3.2.0
zExceptions = 4.1
zc.lockfile = 1.4
zc.lockfile = 2.0
zdaemon = 4.3
zodbpickle = 1.0.4
zope.annotation = 4.7.0
Expand Down Expand Up @@ -78,7 +78,7 @@ zope.pagetemplate = 4.4.1
zope.processlifetime = 2.3.0
zope.proxy = 4.3.2
zope.ptresource = 4.2.0
zope.publisher = 5.1.0
zope.publisher = 5.1.1
zope.ramcache = 2.3
zope.schema = 4.9.3
zope.security = 4.3.1
Expand Down
28 changes: 15 additions & 13 deletions versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,23 @@ collective.recipe.cmd = 0.11
collective.recipe.sphinxbuilder = 1.1
collective.recipe.template = 2.1
colorama = 0.4.1
configparser = 3.7.4
configparser = 3.8.1
contextlib2 = 0.5.5
coverage = 4.5.4
docutils = 0.15.2
filelock = 3.0.12
idna = 2.8
imagesize = 1.1.0
importlib-metadata = 0.19
lxml = 4.4.0
importlib-metadata = 0.20
lxml = 4.4.1
manuel = 1.10.1
# Version 6+ needs Python 3.x
more-itertools = 5.0.0
mr.developer = 2.0.0
nose = 1.3.7
packaging = 19.1
pathlib2 = 2.3.4
pip = 19.2.1
pip = 19.2.3
pkginfo = 1.5.0.1
plone.recipe.command = 1.1
pluggy = 0.12.0
Expand All @@ -54,21 +56,21 @@ requests = 2.22.0
requests-toolbelt = 0.9.1
scandir = 1.10.0
snowballstemmer = 1.9
soupsieve = 1.9.2
soupsieve = 1.9.3
sphinx-rtd-theme = 0.4.3
sphinxcontrib-websupport = 1.1.2
toml = 0.10.0
tox = 3.13.2
tqdm = 4.32.2
tox = 3.14.0
tqdm = 4.35.0
twine = 1.13.0
typing = 3.7.4
typing = 3.7.4.1
urllib3 = 1.25.3
virtualenv = 16.7.2
virtualenv = 16.7.5
webencodings = 0.5.1
wheel = 0.33.4
wheel = 0.33.6
z3c.checkversions = 1.1
zc.recipe.egg = 2.0.7
zc.recipe.testrunner = 2.1
zest.releaser = 6.19.0
zipp = 0.5.2
zodbupdate = 1.3
zest.releaser = 6.19.1
zipp = 0.6.0
zodbupdate = 1.4

0 comments on commit 0e2b69d

Please sign in to comment.