description is getting modified when tagging bugs

Bug #138092 reported by Brian Murray
6
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
Undecided
Markus Korn

Bug Description

The description of bug reports is getting modified when people are tagging bugs. I tagged bug 135041 as kernel-oops and then received this in an e-mail via the ubuntu-bugs mailing list:

** Description changed:

- TSA kernel: [ 1031.856198] SMP $
+ TSA kernel: [ 1031.856198] SMP$

The "$" is the end of the line in vim. It seems that python-launchpad-bugs is stripping the trailing space at the end of the line.

Revision history for this message
Kees Cook (kees) wrote :

The issue seems to be a few things:

1) LP strips trailing spaces and duplicate empty lines when displaying the description, but not when producing the textarea in the "Edit description" page's form.
2) p-lp-b uses the displayed description, not the description from the (other page's) form.
3) p-lp-b does not "know" that its description hasn't been changed, and overwrites the form's description with its internal string in all situations, rather than maintaining some kind "dirty" flag to know when to overwrite the form's description.

#1 is likely not fixable in near-term
#2 is correct if we optimize for speed (though perhaps requests for the description _should_ go fetch it from the form?)
#3 should be fixable, and seems like a reasonable compromise: dropping trailing spaces and dup blanks on an update -- but only when the description actually changes.

Revision history for this message
Markus Korn (thekorn) wrote :

Good point, although in my opinion this is more a bug in launchpad. launchpad automatically removes spaces from the last line, why not removing trailing spaces from all lines?

@Kees: I agree with you, except the fact that py-lp-bugs does know what changed, it is in bug.changed.

As a solution I propose:
 * using the description parsed from the bugreport in almost all cases
 * if tags, summary or nickname were changed, but not description, parse the "Edit description" page's form while the 'commit'-process and use this as description in the http-request
 * if description was changed by the user anyway IMHO it is not a problem removing all trailing spaces and duplicate empty lines

What do you think?

Markus

Revision history for this message
Kees Cook (kees) wrote : Re: [Bug 138092] Re: description is getting modified when tagging bugs

Yeah, I think that would be ideal. :)

Revision history for this message
Markus Korn (thekorn) wrote :

This patch against py-lp-bugs' .main branch r44 changes the process as described in comment #2.

Markus

Changed in python-launchpad-bugs:
status: New → Fix Committed
Revision history for this message
Daniel Holbach (dholbach) wrote :

Markus: thanks a lot! Uploaded.

Changed in python-launchpad-bugs:
assignee: nobody → thekorn
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.