Commit b3248fba authored by 's avatar

- TraversalError is now LocationError

- import cleanup
parent 4529cae0
...@@ -35,7 +35,7 @@ from ZODB.POSException import ConflictError ...@@ -35,7 +35,7 @@ from ZODB.POSException import ConflictError
from zope.interface import implements from zope.interface import implements
from zope.interface import Interface from zope.interface import Interface
from zope.component import queryMultiAdapter from zope.component import queryMultiAdapter
from zope.traversing.interfaces import TraversalError from zope.location.interfaces import LocationError
from zope.traversing.namespace import namespaceLookup from zope.traversing.namespace import namespaceLookup
from zope.traversing.namespace import nsParse from zope.traversing.namespace import nsParse
...@@ -68,7 +68,7 @@ class Traversable: ...@@ -68,7 +68,7 @@ class Traversable:
return self.virtual_url_path() return self.virtual_url_path()
spp = self.getPhysicalPath() spp = self.getPhysicalPath()
try: try:
toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL
except AttributeError: except AttributeError:
...@@ -204,7 +204,7 @@ class Traversable: ...@@ -204,7 +204,7 @@ class Traversable:
if restricted and not validate( if restricted and not validate(
obj, obj, name, next): obj, obj, name, next):
raise Unauthorized(name) raise Unauthorized(name)
except TraversalError: except LocationError:
raise AttributeError(name) raise AttributeError(name)
elif bobo_traverse is not None: elif bobo_traverse is not None:
......
...@@ -14,22 +14,26 @@ ...@@ -14,22 +14,26 @@
$Id$ $Id$
""" """
from urllib import quote as urllib_quote from urllib import quote as urllib_quote
import xmlrpc import xmlrpc
from zExceptions import Forbidden, NotFound
from Acquisition import aq_base from Acquisition import aq_base
from Acquisition.interfaces import IAcquirer from Acquisition.interfaces import IAcquirer
from zExceptions import Forbidden
from zope.interface import implements, Interface from zExceptions import NotFound
from zope.component import queryMultiAdapter from zope.component import queryMultiAdapter
from zope.event import notify from zope.event import notify
from zope.interface import implements
from zope.interface import Interface
from zope.location.interfaces import LocationError
from zope.publisher.defaultview import queryDefaultViewName from zope.publisher.defaultview import queryDefaultViewName
from zope.publisher.interfaces import EndRequestEvent from zope.publisher.interfaces import EndRequestEvent
from zope.publisher.interfaces import IPublishTraverse from zope.publisher.interfaces import IPublishTraverse
from zope.publisher.interfaces import NotFound as ztkNotFound from zope.publisher.interfaces import NotFound as ztkNotFound
from zope.publisher.interfaces.browser import IBrowserPublisher from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.traversing.interfaces import TraversalError from zope.traversing.namespace import namespaceLookup
from zope.traversing.namespace import nsParse, namespaceLookup from zope.traversing.namespace import nsParse
UNSPECIFIED_ROLES='' UNSPECIFIED_ROLES=''
...@@ -319,7 +323,7 @@ class BaseRequest: ...@@ -319,7 +323,7 @@ class BaseRequest:
if ns: if ns:
try: try:
ob2 = namespaceLookup(ns, nm, ob, self) ob2 = namespaceLookup(ns, nm, ob, self)
except TraversalError: except LocationError:
raise ztkNotFound(ob, name) raise ztkNotFound(ob, name)
if IAcquirer.providedBy(ob2): if IAcquirer.providedBy(ob2):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment