Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
61df1bb4
Commit
61df1bb4
authored
Jun 16, 2010
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- LP #143946: Provide a more informative error message when a
WebDAV PUT fails.
parent
034c3c3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/webdav/NullResource.py
src/webdav/NullResource.py
+3
-1
src/webdav/tests/testNullResource.py
src/webdav/tests/testNullResource.py
+27
-0
No files found.
doc/CHANGES.rst
View file @
61df1bb4
...
...
@@ -181,6 +181,9 @@ Features Added
Bugs Fixed
++++++++++
- LP #143946: Provide a more informative error message when a
WebDAV PUT fails.
- LP #143261: The (very old-fashioned) Zope2.debug interactive request
debugger still referred to the toplevel module ``Zope``, which was
renamed to ``Zope2`` a long time ago.
...
...
src/webdav/NullResource.py
View file @
61df1bb4
...
...
@@ -166,7 +166,9 @@ class NullResource(Persistent, Implicit, Resource):
try
:
parent
.
_verifyObjectPaste
(
ob
.
__of__
(
parent
),
0
)
except
CopyError
:
raise
Unauthorized
,
sys
.
exc_info
()[
1
]
sMsg
=
'Unable to create object of class %s in %s: %s'
%
\
(
ob
.
__class__
,
repr
(
parent
),
sys
.
exc_info
()[
1
],)
raise
Unauthorized
,
sMsg
# Delegate actual PUT handling to the new object,
# SDS: But just *after* it has been stored.
...
...
src/webdav/tests/testNullResource.py
View file @
61df1bb4
...
...
@@ -48,6 +48,33 @@ class TestNullResource(unittest.TestCase):
self
.
assertEqual
(
response
.
body
,
''
)
self
.
failUnless
(
response
.
locked
)
def
test_PUT_unauthorized_message
(
self
):
# See https://bugs.launchpad.net/bugs/143946
import
ExtensionClass
from
OFS.CopySupport
import
CopyError
from
zExceptions
import
Unauthorized
class
DummyRequest
:
def
get_header
(
self
,
header
,
default
=
''
):
return
default
def
get
(
self
,
name
,
default
=
None
):
return
default
class
DummyResponse
:
_server_version
=
'Dummy'
# emulate ZServer response
def
setHeader
(
self
,
*
args
):
pass
class
DummyParent
(
ExtensionClass
.
Base
):
def
_verifyObjectPaste
(
self
,
*
args
,
**
kw
):
raise
CopyError
(
'Bad Boy!'
)
nonesuch
=
self
.
_makeOne
()
nonesuch
.
__parent__
=
DummyParent
()
request
=
DummyRequest
()
response
=
DummyResponse
()
try
:
nonesuch
.
PUT
(
request
,
response
)
except
Unauthorized
,
e
:
self
.
failUnless
(
str
(
e
).
startswith
(
'Unable to create object'
))
def
test_suite
():
return
unittest
.
TestSuite
((
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment