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

Bug #582995 reported by Bryce Harrington on 2010-05-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Getting Things GNOME!
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/", line 116, in main
    ds = DataStore()
  File "/home/bryce/src/gtg/gtg/GTG/core/", line 48, in __init__
    self.tagstore = tagstore.TagStore(self.requester)
  File "/home/bryce/src/gtg/gtg/GTG/core/", line 81, in __init__
    tag.set_attribute(at_name, at_val)
  File "/home/bryce/src/gtg/gtg/GTG/core/", line 271, in set_attribute
  File "/home/bryce/src/gtg/gtg/GTG/core/", line 203, in save
    cleanxml.savexml(self.filename, doc)
  File "/home/bryce/src/gtg/gtg/GTG/tools/", line 119, in savexml
    pretty = doc.toprettyxml(tab, enter).encode("utf-8")
  File "/usr/lib/python2.6/xml/dom/", line 57, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File "/usr/lib/python2.6/xml/dom/", line 1749, in writexml
    node.writexml(writer, indent, addindent, newl)
  File "/usr/lib/python2.6/xml/dom/", line 817, in writexml
  File "/usr/lib/python2.6/xml/dom/", line 812, in writexml
    _write_data(writer, attrs[a_name].value)
  File "/usr/lib/python2.6/xml/dom/", line 301, in _write_data
    data = data.replace("&", "&amp;").replace("<", "&lt;")
AttributeError: Tag instance has no attribute 'replace'

Related branches

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'"
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
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

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.

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
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).

Luca Invernizzi (invernizzi) wrote :

Ok, have a look.

Bryce Harrington (bryce) wrote :

Yep, confirmed fixed on gtg trunk.

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

Other bug subscribers