[Zope3-checkins] SVN: Zope3/trunk/src/z - fixed issue 575,
port from 3.3 branch
Christian Theune
cvs-admin at zope.org
Sun Jun 18 18:54:59 EDT 2006
Log message for revision 68738:
- fixed issue 575, port from 3.3 branch
Changed:
U Zope3/trunk/src/zope/app/container/traversal.py
U Zope3/trunk/src/zope/app/pagetemplate/engine.py
U Zope3/trunk/src/zope/app/schema/browser/traversal.py
U Zope3/trunk/src/zope/traversing/namespace.py
U Zope3/trunk/src/zwiki/traversal.py
-=-
Modified: Zope3/trunk/src/zope/app/container/traversal.py
===================================================================
--- Zope3/trunk/src/zope/app/container/traversal.py 2006-06-18 22:49:03 UTC (rev 68737)
+++ Zope3/trunk/src/zope/app/container/traversal.py 2006-06-18 22:54:54 UTC (rev 68738)
@@ -97,6 +97,6 @@
if v is _marker:
v = getattr(container, name, _marker)
if v is _marker:
- raise TraversalError(name)
+ raise TraversalError(container, name)
return v
Modified: Zope3/trunk/src/zope/app/pagetemplate/engine.py
===================================================================
--- Zope3/trunk/src/zope/app/pagetemplate/engine.py 2006-06-18 22:49:03 UTC (rev 68737)
+++ Zope3/trunk/src/zope/app/pagetemplate/engine.py 2006-06-18 22:54:54 UTC (rev 68738)
@@ -375,7 +375,7 @@
try:
return self[name]
except KeyError:
- raise TraversalError(name)
+ raise TraversalError(self, name)
def _Engine(engine=None):
Modified: Zope3/trunk/src/zope/app/schema/browser/traversal.py
===================================================================
--- Zope3/trunk/src/zope/app/schema/browser/traversal.py 2006-06-18 22:49:03 UTC (rev 68737)
+++ Zope3/trunk/src/zope/app/schema/browser/traversal.py 2006-06-18 22:54:54 UTC (rev 68738)
@@ -69,6 +69,6 @@
def traverse(self, name, furtherPath):
subobj = self._context.get(name, _marker)
if subobj is _marker:
- raise TraversalError(name)
+ raise TraversalError(self._context, name)
return subobj
Modified: Zope3/trunk/src/zope/traversing/namespace.py
===================================================================
--- Zope3/trunk/src/zope/traversing/namespace.py 2006-06-18 22:49:03 UTC (rev 68737)
+++ Zope3/trunk/src/zope/traversing/namespace.py 2006-06-18 22:54:54 UTC (rev 68738)
@@ -65,19 +65,19 @@
If we give an invalid namespace, we'll get a not found error:
- >>> namespaceLookup('fiz', 'bar', C())
+ >>> namespaceLookup('fiz', 'bar', C()) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
- TraversalError: '++fiz++bar'
+ TraversalError: (<zope.traversing.namespace.C object at 0x...>, '++fiz++bar')
We'll get the same thing if we provide a request:
>>> from zope.publisher.browser import TestRequest
>>> request = TestRequest()
- >>> namespaceLookup('foo', 'bar', C(), request)
+ >>> namespaceLookup('foo', 'bar', C(), request) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
- TraversalError: '++foo++bar'
+ TraversalError: (<zope.traversing.namespace.C object at 0x...>, '++foo++bar')
We need to provide a view:
@@ -104,7 +104,7 @@
traverser = zope.component.queryAdapter(object, ITraversable, ns)
if traverser is None:
- raise TraversalError("++%s++%s" % (ns, name))
+ raise TraversalError(object, "++%s++%s" % (ns, name))
return traverser.traverse(name, ())
@@ -205,7 +205,7 @@
... def traverse(self, name, remaining):
... v = getattr(self, name, None)
... if v is None:
- ... raise TraversalError(name)
+ ... raise TraversalError(self, name)
... return v
... def __repr__(self):
... return 'splat'
Modified: Zope3/trunk/src/zwiki/traversal.py
===================================================================
--- Zope3/trunk/src/zwiki/traversal.py 2006-06-18 22:49:03 UTC (rev 68737)
+++ Zope3/trunk/src/zwiki/traversal.py 2006-06-18 22:54:54 UTC (rev 68738)
@@ -75,6 +75,6 @@
if subobj is _marker:
subobj = getattr(self._page, name, _marker)
if subobj is _marker:
- raise TraversalError(name)
+ raise TraversalError(self._page, name)
return subobj
More information about the Zope3-Checkins
mailing list