[1.1.0] Testing multiline string displays its value two times

Bug #1154680 reported by Yann Papouin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aeroo Reporting library
Medium
Unassigned

Bug Description

Check file attached, and look at the "if" for "Notes" attribute.
As you can see in the result there is an issue if the string is multiline

Revision history for this message
Yann Papouin (yann-papouin) wrote :
Revision history for this message
Yann Papouin (yann-papouin) wrote :
summary: - [1.1.0] Testing multiline string displays it's value two times
+ [1.1.0] Testing multiline string displays its value two times
Revision history for this message
sraps (Alistek) (erpsraps) wrote :

I confirm this bug. It is present in Aeroo python library.

affects: aeroo → aeroolib
Changed in aeroolib:
status: New → Confirmed
Changed in aeroolib:
status: Confirmed → Fix Committed
importance: Undecided → Medium
Revision history for this message
Yann Papouin (yann-papouin) wrote :

I've just tested with latest revision (aeroo and aeroolib re-install), and the problem is still there

Revision history for this message
Yann Papouin (yann-papouin) wrote :

And nothing to do with that bug but you have to replace:
  res=val.replace('\t', TAB).replace('\n', NEW_LINE).replace('\r\n', NEW_LINE)
with:
  res=val.replace('\t', TAB).replace('\r\n', NEW_LINE).replace('\n', NEW_LINE)

Revision history for this message
Yann Papouin (yann-papouin) wrote :

I think that the problem comes from "def check_new_lines(self, tree, namespaces)"
In that function, there is two loops, the first for "span" nodes and the second for "text" nodes.

Apparently both loops are always executed, so to avoid tag reparsing, I've added at the end of the first loop:

     if tag.text:
          tag.getparent().remove(tag)

Changed in aeroolib:
status: Fix Committed → New
Changed in aeroolib:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers