GTG

Localfile backend falls on XML comment in tasks file

Bug #820275 reported by Izidor Matušov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Low
Diego Garcia Gangl

Bug Description

Let's have localfile like this:
<file>
<?xml version="1.0" ?>
<project>
        <task id="2@1" status="Active" tags=""> <title>2@1</title> <content> </content> </task>
        <!--
        <task id="3@1" status="Active" tags=""> <title>3@1</title> <content> </content> </task>
        -->
</project>
</file>

The traceback:
<traceback>
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/iyo/projekte/liblarch/integrate-liblarch-to-gtg/GTG/core/datastore.py", line 598, in __start_get_tasks
    self.backend.start_get_tasks()
  File "/home/iyo/projekte/liblarch/integrate-liblarch-to-gtg/GTG/backends/backend_localfile.py", line 142, in start_get_tasks
    tid = node.getAttribute("id")
AttributeError: Text instance has no attribute 'getAttribute'
</traceback>

It is because the parser of XML create an empty text element.

Tags: backend github
Izidor Matušov (izidor)
Changed in gtg:
assignee: nobody → Izidor Matušov (izidor)
Revision history for this message
Izidor Matušov (izidor) wrote :

Lionel told me that problem is because of its own parsing algorithm. I might look at it. Another problem is that <a> x </a> is not the same as <a>x</a>. Maybe add strip at the beginning and the end of content? It might be not important to preserve whitespace in the beginning and the end of content of task.

Izidor Matušov (izidor)
Changed in gtg:
assignee: Izidor Matušov (izidor) → nobody
Izidor Matušov (izidor)
Changed in gtg:
assignee: nobody → Izidor Matušov (izidor)
Izidor Matušov (izidor)
Changed in gtg:
milestone: 0.3 → 0.4
Izidor Matušov (izidor)
Changed in gtg:
assignee: Izidor Matušov (izidor) → nobody
Izidor Matušov (izidor)
tags: added: github
Jeff Fortin Tam (kiddo)
Changed in gtg:
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
assignee: nobody → Diego Garcia Gangl (dnicolas)
Jeff Fortin Tam (kiddo)
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.