GTG

Crash on start - "Tag instance has no attribute 'replace'"

Bug #582995 reported by Bryce Harrington
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Critical
Luca Invernizzi

Bug Description

Running gtg trunk results in a crash with the following error. Also, it causes tags.xml to zero:

-rw-r--r-- 1 bryce bryce 0 2010-05-19 11:14 tags.xml
-rw-r--r-- 1 bryce bryce 702 2010-05-19 11:14 tags.xml__

Even the (backup?) is invalid. The correct size of tags.xml is:

-rw-r--r-- 1 bryce bryce 3839 2010-05-19 11:14 tags.xml

Original exception was:
Traceback (most recent call last):
  File "./gtg", line 52, in <module>
    sys.exit(GTG.gtg.main(options, args))
  File "/home/bryce/src/gtg/gtg/GTG/gtg.py", line 116, in main
    ds = DataStore()
  File "/home/bryce/src/gtg/gtg/GTG/core/datastore.py", line 48, in __init__
    self.tagstore = tagstore.TagStore(self.requester)
  File "/home/bryce/src/gtg/gtg/GTG/core/tagstore.py", line 81, in __init__
    tag.set_attribute(at_name, at_val)
  File "/home/bryce/src/gtg/gtg/GTG/core/tagstore.py", line 271, in set_attribute
    self._save()
  File "/home/bryce/src/gtg/gtg/GTG/core/tagstore.py", line 203, in save
    cleanxml.savexml(self.filename, doc)
  File "/home/bryce/src/gtg/gtg/GTG/tools/cleanxml.py", line 119, in savexml
    pretty = doc.toprettyxml(tab, enter).encode("utf-8")
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 57, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 1749, in writexml
    node.writexml(writer, indent, addindent, newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 812, in writexml
    _write_data(writer, attrs[a_name].value)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 301, in _write_data
    data = data.replace("&", "&amp;").replace("<", "&lt;")
AttributeError: Tag instance has no attribute 'replace'

Tags: regression

Related branches

Revision history for this message
Bryce Harrington (bryce) wrote :

This crash occurs with revisions 757 and 758, but not in revision 756 or earlier.

tags: added: regression
summary: - Tag instance has no attribute 'replace'
+ Crash on start - "Tag instance has no attribute 'replace'"
Revision history for this message
Bryce Harrington (bryce) wrote :

Looking at the change in 757 it's not evident to my why it would crash with this stack trace, but I guess something is wrong with the tag saving functionality. Luca, mind having a look?

Perhaps unless it's obvious to you we should revert this change until tomorrow, so folks can test for regressions?

Changed in gtg:
assignee: nobody → Luca Invernizzi (invernizzi)
importance: Undecided → Critical
milestone: none → 0.3
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

well, before 757 tags.xml was always almost empty, so no crash would be possible. Anyway, I'm going out now, so I've rolled back trunk to 756

Revision history for this message
Bryce Harrington (bryce) wrote : Re: [Bug 582995] Re: Crash on start - "Tag instance has no attribute 'replace'"

On Wed, May 19, 2010 at 06:54:57PM -0000, Luca Invernizzi wrote:
> well, before 757 tags.xml was always almost empty, so no crash would be
> possible. Anyway, I'm going out now, so I've rolled back trunk to 756

Ah, weird. Well fwiw I was testing this by (re-)copying the tags.xml
from a 0.2.x-based setup each run.

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

it seems that "get_parent()" in a tag tree sometimes spits out the parents ids, sometimes the objects. I'll try to find out who misbehaves..

Changed in gtg:
status: New → Fix Committed
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Launchpad does not accept my code anymore for a still unknown reason, but it should be fixed now. Bryce, when you feel like it please have a try (after I've pushed).

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Ok, have a look.

Revision history for this message
Bryce Harrington (bryce) wrote :

Yep, confirmed fixed on gtg trunk.

Changed in gtg:
milestone: 0.3 → 0.2.9
Izidor Matušov (izidor)
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.