Merge lp://staging/~bryce/apport/omit_empty into lp://staging/~apport-hackers/apport/trunk

Proposed by Bryce Harrington
Status: Merged
Merged at revision: 1918
Proposed branch: lp://staging/~bryce/apport/omit_empty
Merge into: lp://staging/~apport-hackers/apport/trunk
Diff against target: 41 lines (+6/-4)
1 file modified
apport/hookutils.py (+6/-4)
To merge this branch: bzr merge lp://staging/~bryce/apport/omit_empty
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+68616@code.staging.launchpad.net

Description of the change

Fixes a couple typos

Fixes 813798 by adding 'omit_empty' flag to attach_root_command_outputs() so it doesn't append empty fields when a command gives no output.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for the typo fixes!

As for the attach_root_command_outputs() fix, I feel that it would make more sense to just always skip empty keys. Also, I think we should always strip() the result, leading and trailing empty lines have little information (I'm not aware of apport hooks that attach brainfuck source :) ).

So WDYT about this:

   buf = f.read.strip()
   if not buf:
       continue

?

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

On Thu, Jul 21, 2011 at 04:32:33AM -0000, Martin Pitt wrote:
> Review: Needs Information
> Thanks for the typo fixes!
>
> As for the attach_root_command_outputs() fix, I feel that it would make more sense to just always skip empty keys. Also, I think we should always strip() the result, leading and trailing empty lines have little information (I'm not aware of apport hooks that attach brainfuck source :) ).
>
> So WDYT about this:
>
> buf = f.read.strip()
> if not buf:
> continue
>
> ?

Yep, that would actually be my preference. Just wasn't sure whether you
wanted to keep the empties for some reason.

Bryce

1921. By Bryce Harrington

Review by pitti: Just always strip and always skip empties.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches