Merge ~cjwatson/launchpad:more-warning-handler-info into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 877a79a3e7efcc8c77b8decb54e5f849962f795b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:more-warning-handler-info
Merge into: launchpad:master
Diff against target: 12 lines (+1/-1)
1 file modified
lib/lp/scripts/utilities/warninghandler.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+374682@code.launchpad.net

Commit message

Fix incomplete messages from warning handler

The warning handler sometimes emitted messages like this (with local
paths shortened for brevity):

  The method SimpleViewClass from .../lib/lp/bugs/browser/../templates/buglisting-default.pt._getBatchNavigator
  The doctest <doctest xx-bug-subscriptions.txt[4]>, at the line:
      >>> browser.getControl('Save these changes').click()

This is clearly incomplete. With this change, we instead get:

  The method SimpleViewClass from .../lib/lp/bugs/browser/../templates/buglisting-default.pt._getBatchNavigator
  The doctest <doctest xx-bug-subscriptions.txt[4]>, at the line:
      >>> browser.getControl('Save these changes').click()

  .../env/lib/python2.7/site-packages/lazr/batchnavigator/_batchnavigator.py:82: PendingDeprecationWarning: cgi.parse_qs is deprecated, use urlparse.parse_qs instead
    return cgi.parse_qs(query_string, keep_blank_values=True)

Description of the change

The previous messages were a bit "Shaka, when the walls fell".

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/scripts/utilities/warninghandler.py b/lib/lp/scripts/utilities/warninghandler.py
2index 4a489d7..026f69e 100644
3--- a/lib/lp/scripts/utilities/warninghandler.py
4+++ b/lib/lp/scripts/utilities/warninghandler.py
5@@ -22,7 +22,7 @@ class WarningReport:
6 def __str__(self):
7 info = str(self.info)
8 if info:
9- return info
10+ return '\n'.join((info, self.message))
11 else:
12 return self.message
13

Subscribers

People subscribed via source and target branches

to status/vote changes: