Commit 83f6a3ad authored by Andreas Jung's avatar Andreas Jung

- Collector #1944: HTTPRequest.resolve_url has error in raising errors

parent ac58f839
...@@ -33,6 +33,8 @@ Zope Changes ...@@ -33,6 +33,8 @@ Zope Changes
- Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership - Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership
- Collector #1944: HTTPRequest.resolve_url has error in raising errors
Zope 2.10.0 beta 1 (2006/05/30) Zope 2.10.0 beta 1 (2006/05/30)
Restructuring Restructuring
......
...@@ -1042,7 +1042,7 @@ class HTTPRequest(BaseRequest): ...@@ -1042,7 +1042,7 @@ class HTTPRequest(BaseRequest):
except: rsp.exception() except: rsp.exception()
if object is None: if object is None:
req.close() req.close()
raise rsp.errmsg, sys.exc_info()[1] raise sys.exc_info()[0], rsp.errmsg
# The traversal machinery may return a "default object" # The traversal machinery may return a "default object"
# like an index_html document. This is not appropriate # like an index_html document. This is not appropriate
......
...@@ -700,6 +700,19 @@ class RequestTests( unittest.TestCase ): ...@@ -700,6 +700,19 @@ class RequestTests( unittest.TestCase ):
self.assertEqual(f.next(),'test\n') self.assertEqual(f.next(),'test\n')
f.seek(0) f.seek(0)
self.assertEqual(f.xreadlines(),f) self.assertEqual(f.xreadlines(),f)
def testResolveUrl(self):
# Check that ResolveUrl really raises the same error
# it received from ZPublisher.BaseRequest.traverse
# collector entry 1944
from ZPublisher.HTTPRequest import HTTPRequest
from zExceptions import NotFound
env = TEST_ENVIRON.copy()
req = HTTPRequest(None, env, None)
req['PARENTS'] = ['Nobody', 'cares', 'here']
testmethod = req.resolve_url
self.assertRaises(NotFound, testmethod, 'http://localhost/does_not_exist')
def testDebug(self): def testDebug(self):
TEST_ENVIRON = { TEST_ENVIRON = {
......
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