Code review comment for lp:~spud/spud/copy-paste-fix

Revision history for this message
Cian Wilson (cwilson) wrote :

Repeating the steps (and using the schema and options file) in bug #811200 (i.e. activating a new nonlinear_solver element, copying nonlinear_solver::Simple and trying to paste it into the new active element - using Ctrl+C and Ctrl+V) I get the error:

  File "/usr/lib/python2.7/dist-packages/diamond/", line 684, in on_paste
    newnode =, node)
  File "/usr/lib/python2.7/dist-packages/diamond/", line 526, in read
    datatree = self.valid_node(root)
  File "/usr/lib/python2.7/dist-packages/diamond/", line 156, in valid_node
    xpath = self.tree.xpath(eid)
  File "lxml.etree.pyx", line 2029, in lxml.etree._ElementTree.xpath (src/lxml/lxml.etree.c:45934)
  File "xpath.pxi", line 363, in lxml.etree.XPathDocumentEvaluator.__call__ (src/lxml/lxml.etree.c:114234)
  File "apihelpers.pxi", line 1364, in lxml.etree._utf8 (src/lxml/lxml.etree.c:22190)
TypeError: Argument must be bytes or unicode, got 'Choice'

Nothing appears in the pasted to element.

If I then delete the node that I just failed to copy information to and save the file, close it and reopen it, it reappears as I last saw (and saved) it so that part of the bug appears fixed.

I get the same error using right-click copy and paste and if the element being pasted to is active or not.

Can anyone reproduce this with this branch? I've built packages from this branch and overwritten my previously installed spud so am reasonably confident I'm not getting paths muddled.

review: Needs Information

« Back to merge proposal