Ticket #6096 (closed Bug: worksforme)
Editing document with cadaver raises ValueError
| Reported by: | sgillies | Owned by: | keul |
|---|---|---|---|
| Priority: | major | Milestone: | 3.3 |
| Component: | Infrastructure | Keywords: | TuneUp12 |
| Cc: | lucafbb@… |
Description
manage_afterPUT is getting a closed file from WebDAVSupport.PUT.
Traceback (innermost last): Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module Products.Archetypes.WebDAVSupport, line 117, in PUT Module Products.ATContentTypes.content.document, line 258, in manage_afterPUT ValueError: I/O operation on closed file
I originally reported this in the Marshall tracker, but Sidnei said it was certainly an ATCT bug.
Using: Plone 2.5.1, Zope 2.9.5, Marshall 0.6.1, python-libxml2 2.6.21.
The bug can be reproduced by following the Marshall tutorial at
http://plone.org/documentation/tutorial/xml-in-plone-with-marshall
I followed Paul Everitt's steps to the letter.
$ cadaver http://localhost:8080/plone $ edit front-page
The traceback I reported above occurs immediately after writing from vi (cadaver's editor).
Change History
comment:1 Changed 4 years ago by hannosch
- Keywords marshall put document removed
- Type changed from defect to Bug
comment:5 Changed 3 years ago by keul
We were not able to fix this in the TuneUp:
The problem is the use of cElementTree in the atxml.py source. If you don't have the cElementTree but use the python native elementree, you'll get no error.
The problem:
def processXml(self, context, node):
""" handle the start of a xml tag with this namespace
the namespace and the name of the tag are bound to node.
if this method return false then the node is assumed to
be junk and it is discarded.
"""
tag, ns = utils.fixtag(node.tag,context.ns_map)
attribute = self.getAttributeByName( tag )
if attribute is None:
return False
node.attribute = attribute # <!-- wrong with cElementTree
return attribute.processXml( context, node)
Doing node.attribute = attribute in bad when the class in implemented in C language. Seems that you can't add additional attributes to native objects.
comment:6 Changed 3 years ago by keul
- Status changed from assigned to new
- Cc lucafbb@… added
- Owner changed from amleczko to keul
The problem isn't related to the use of Cadaver or editing content using webdav, but only to the internal usage of cElementTree.
Lets open a new ticket for this (#9026).
For users that wanna modify the content with Cadaver: for now simply remove the cElementTree dependency.

This needs verification against a current Plone release.