Merge lp:~cjwatson/launchpad/bugs-doctests-future-imports into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18708
Proposed branch: lp:~cjwatson/launchpad/bugs-doctests-future-imports
Merge into: lp:launchpad
Diff against target: 8085 lines (+1184/-1153)
75 files modified
lib/lp/bugs/doc/bug-change.txt (+43/-43)
lib/lp/bugs/doc/bug-reported-acknowledgement.txt (+4/-4)
lib/lp/bugs/doc/bug-reporting-guidelines.txt (+4/-4)
lib/lp/bugs/doc/bug-tags.txt (+12/-12)
lib/lp/bugs/doc/bug-watch-activity.txt (+14/-14)
lib/lp/bugs/doc/bug.txt (+96/-96)
lib/lp/bugs/doc/bugactivity.txt (+17/-17)
lib/lp/bugs/doc/bugattachments.txt (+25/-25)
lib/lp/bugs/doc/bugcomment.txt (+8/-8)
lib/lp/bugs/doc/bugnotification-email.txt (+41/-41)
lib/lp/bugs/doc/bugnotification-sending.txt (+30/-30)
lib/lp/bugs/doc/bugnotifications.txt (+25/-25)
lib/lp/bugs/doc/bugsubscription.txt (+12/-12)
lib/lp/bugs/doc/bugsummary.txt (+10/-10)
lib/lp/bugs/doc/bugtarget.txt (+13/-13)
lib/lp/bugs/doc/bugtask-assignee-widget.txt (+6/-6)
lib/lp/bugs/doc/bugtask-bugwatch-widget.txt (+7/-7)
lib/lp/bugs/doc/bugtask-display-widgets.txt (+7/-7)
lib/lp/bugs/doc/bugtask-expiration.txt (+11/-11)
lib/lp/bugs/doc/bugtask-find-similar.txt (+5/-5)
lib/lp/bugs/doc/bugtask-package-bugcounts.txt (+2/-2)
lib/lp/bugs/doc/bugtask-retrieval.txt (+1/-1)
lib/lp/bugs/doc/bugtask-search-old-urls.txt (+8/-7)
lib/lp/bugs/doc/bugtask-search.txt (+18/-18)
lib/lp/bugs/doc/bugtask-status-changes.txt (+1/-1)
lib/lp/bugs/doc/bugtask-status-workflow.txt (+13/-13)
lib/lp/bugs/doc/bugtracker-person.txt (+16/-16)
lib/lp/bugs/doc/bugtracker-tokens.txt (+6/-6)
lib/lp/bugs/doc/bugtracker.txt (+15/-15)
lib/lp/bugs/doc/bugwatch.txt (+18/-18)
lib/lp/bugs/doc/checkwatches-batching.txt (+2/-2)
lib/lp/bugs/doc/checkwatches-cli-switches.txt (+1/-1)
lib/lp/bugs/doc/checkwatches.txt (+6/-6)
lib/lp/bugs/doc/cve-update.txt (+8/-8)
lib/lp/bugs/doc/cve.txt (+1/-1)
lib/lp/bugs/doc/displaying-bugs-and-tasks.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-bug-imports.txt (+7/-7)
lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt (+29/-29)
lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt (+18/-18)
lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt (+10/-10)
lib/lp/bugs/doc/externalbugtracker-bugzilla.txt (+23/-23)
lib/lp/bugs/doc/externalbugtracker-checkwatches.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-comment-imports.txt (+15/-15)
lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt (+12/-12)
lib/lp/bugs/doc/externalbugtracker-debbugs.txt (+58/-57)
lib/lp/bugs/doc/externalbugtracker-emailaddress.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-linking-back.txt (+4/-4)
lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt (+5/-5)
lib/lp/bugs/doc/externalbugtracker-mantis.txt (+5/-5)
lib/lp/bugs/doc/externalbugtracker-roundup-python-bugs.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-rt.txt (+3/-3)
lib/lp/bugs/doc/externalbugtracker-sourceforge.txt (+4/-4)
lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt (+57/-38)
lib/lp/bugs/doc/externalbugtracker-trac.txt (+11/-11)
lib/lp/bugs/doc/externalbugtracker.txt (+38/-38)
lib/lp/bugs/doc/filebug-data-parser.txt (+20/-20)
lib/lp/bugs/doc/initial-bug-contacts.txt (+9/-9)
lib/lp/bugs/doc/malone-karma.txt (+2/-2)
lib/lp/bugs/doc/malone-xmlrpc.txt (+18/-18)
lib/lp/bugs/doc/official-bug-tags.txt (+6/-6)
lib/lp/bugs/doc/product-update-remote-product-script.txt (+1/-1)
lib/lp/bugs/doc/product-update-remote-product.txt (+6/-6)
lib/lp/bugs/doc/products-with-no-remote-product.txt (+1/-1)
lib/lp/bugs/doc/sourceforge-remote-products.txt (+6/-6)
lib/lp/bugs/doc/structural-subscriptions.txt (+9/-9)
lib/lp/bugs/doc/treelookup.txt (+32/-31)
lib/lp/bugs/doc/vocabularies.txt (+22/-22)
lib/lp/bugs/tests/bugs-emailinterface.txt (+127/-126)
lib/lp/bugs/tests/bugtarget-questiontarget.txt (+1/-1)
lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt (+25/-25)
lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt (+21/-21)
lib/lp/bugs/tests/structural-subscription-target.txt (+2/-2)
lib/lp/bugs/tests/test_doc.py (+25/-20)
lib/lp/bugs/tests/test_externalbugtracker.py (+11/-8)
lib/lp/bugs/tests/trac-xmlrpc-transport.txt (+27/-27)
To merge this branch: bzr merge lp:~cjwatson/launchpad/bugs-doctests-future-imports
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+348785@code.launchpad.net

Commit message

Convert doctests under lp.bugs to Launchpad's preferred __future__ imports.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Self-approving more tedious and bulky __future__ work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/doc/bug-change.txt'
2--- lib/lp/bugs/doc/bug-change.txt 2017-05-31 17:31:58 +0000
3+++ lib/lp/bugs/doc/bug-change.txt 2018-06-30 11:02:51 +0000
4@@ -31,10 +31,10 @@
5
6 But the basic attributes are still available.
7
8- >>> print base_instance.when
9+ >>> print(base_instance.when)
10 2009-03-13 10:09:00+00:00
11
12- >>> print base_instance.person.displayname
13+ >>> print(base_instance.person.displayname)
14 Ford Prefect
15
16 Because the base class is abstract, you can't pass it to
17@@ -86,10 +86,10 @@
18 >>> def print_bug_activity(activity):
19 ... for activity in activity:
20 ... if activity not in activity_to_ignore:
21- ... print "%s: %s %s => %s (%s)" % (
22+ ... print("%s: %s %s => %s (%s)" % (
23 ... activity.datechanged, activity.whatchanged,
24 ... activity.oldvalue, activity.newvalue,
25- ... activity.person.displayname)
26+ ... activity.person.displayname))
27
28 Creating bugs generates activity records, indirectly, using the
29 addChange() API, but we want to ignore them for now.
30@@ -108,14 +108,14 @@
31
32 >>> from lp.bugs.model.bugnotification import BugNotification
33 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
34- >>> print latest_notification.message.text_contents
35+ >>> print(latest_notification.message.text_contents)
36 Some message text
37
38 The notification's recipients are taken from the recipients parameter
39 passed to addChange().
40
41 >>> for recipient in latest_notification.recipients:
42- ... print recipient.person.displayname
43+ ... print(recipient.person.displayname)
44 Zaphod Beeblebrox
45
46 But if getBugActivity() returns None, no activity entries will be added.
47@@ -159,14 +159,14 @@
48 >>> example_bug.addChange(
49 ... TestBugChange(when=nowish, person=example_person))
50 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
51- >>> print latest_notification.message.text_contents
52+ >>> print(latest_notification.message.text_contents)
53 Some message text
54
55 >>> recipients = [
56 ... recipient.person.displayname
57 ... for recipient in latest_notification.recipients]
58 >>> for name in sorted(recipients):
59- ... print name
60+ ... print(name)
61 Ford Prefect
62 Meta-data subscriber
63
64@@ -234,10 +234,10 @@
65 method.
66
67 >>> activity_data = simple_change.getBugActivity()
68- >>> print pretty(activity_data)
69- {'newvalue': 'Spam',
70+ >>> print(pretty(activity_data))
71+ {'newvalue': u'Spam',
72 'oldvalue': u'Reality is on the blink again',
73- 'whatchanged': 'title'}
74+ 'whatchanged': u'title'}
75
76
77 === BugDescriptionChange ===
78@@ -253,7 +253,7 @@
79 ... when=nowish, person=example_person,
80 ... what_changed='description', old_value=example_bug.description,
81 ... new_value='Well, maybe not')
82- >>> print bug_desc_change.getBugNotification()['text']
83+ >>> print(bug_desc_change.getBugNotification()['text'])
84 ** Description changed:
85 <BLANKLINE>
86 - I'm tired of thinking up funny strings for tests
87@@ -273,7 +273,7 @@
88 ... when=nowish, person=example_person,
89 ... what_changed='title', old_value=example_bug.title,
90 ... new_value='Spam')
91- >>> print bug_title_change.getBugNotification()['text']
92+ >>> print(bug_title_change.getBugNotification()['text'])
93 ** Summary changed:
94 <BLANKLINE>
95 - Reality is on the blink again
96@@ -283,7 +283,7 @@
97 'summary' rather than 'title'. This is to maintain naming consistency
98 within the UI.
99
100- >>> print bug_title_change.getBugActivity()['whatchanged']
101+ >>> print(bug_title_change.getBugActivity()['whatchanged'])
102 summary
103
104
105@@ -300,14 +300,14 @@
106 ... when=nowish, person=example_person,
107 ... what_changed='duplicateof', old_value=None,
108 ... new_value=duplicate_bug)
109- >>> print bug_duplicate_change.getBugNotification()['text']
110+ >>> print(bug_duplicate_change.getBugNotification()['text'])
111 ** This bug has been marked a duplicate of bug ...
112 Fish can't walk
113
114 BugDuplicateChange overrides getBugActivity() to customize all the
115 returned fields.
116
117- >>> print pretty(bug_duplicate_change.getBugActivity())
118+ >>> print(pretty(bug_duplicate_change.getBugActivity()))
119 {'newvalue': '...',
120 'whatchanged': 'marked as duplicate'}
121
122@@ -329,14 +329,14 @@
123 other attribute change. The list of tags is converted to a
124 space-separated string for display.
125
126- >>> print pretty(tags_change.getBugActivity())
127+ >>> print(pretty(tags_change.getBugActivity()))
128 {'newvalue': u'second-tag third-tag zillionth-tag',
129 'oldvalue': u'first-tag second-tag third-tag',
130- 'whatchanged': 'tags'}
131+ 'whatchanged': u'tags'}
132
133 Addtions and removals are expressed separately in the notification.
134
135- >>> print tags_change.getBugNotification()['text']
136+ >>> print(tags_change.getBugNotification()['text'])
137 ** Tags removed: first-tag
138 ** Tags added: zillionth-tag
139
140@@ -357,11 +357,11 @@
141 >>> bug_cve_linked = CveLinkedToBug(
142 ... when=nowish, person=example_person, cve=cve)
143
144- >>> print pretty(bug_cve_linked.getBugActivity())
145+ >>> print(pretty(bug_cve_linked.getBugActivity()))
146 {'newvalue': u'1999-8979',
147 'whatchanged': 'cve linked'}
148
149- >>> print bug_cve_linked.getBugNotification()['text']
150+ >>> print(bug_cve_linked.getBugNotification()['text'])
151 ** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=1999-8979
152
153 And when a CVE is unlinked from a bug.
154@@ -369,11 +369,11 @@
155 >>> bug_cve_unlinked = CveUnlinkedFromBug(
156 ... when=nowish, person=example_person, cve=cve)
157
158- >>> print pretty(bug_cve_unlinked.getBugActivity())
159+ >>> print(pretty(bug_cve_unlinked.getBugActivity()))
160 {'oldvalue': u'1999-8979',
161 'whatchanged': 'cve unlinked'}
162
163- >>> print bug_cve_unlinked.getBugNotification()['text']
164+ >>> print(bug_cve_unlinked.getBugNotification()['text'])
165 ** CVE removed: https://cve.mitre.org/cgi-bin/cvename.cgi?name=1999-8979
166
167
168@@ -394,13 +394,13 @@
169 ... what_changed='security_related',
170 ... old_value=None, new_value=attachment)
171
172- >>> print pretty(attachment_change.getBugActivity())
173+ >>> print(pretty(attachment_change.getBugActivity()))
174 {'newvalue':
175 u'sample-attachment http://bugs.launchpad.dev/bugs/...+files/...',
176 'oldvalue': None,
177 'whatchanged': 'attachment added'}
178
179- >>> print attachment_change.getBugNotification()['text']
180+ >>> print(attachment_change.getBugNotification()['text'])
181 ** Attachment added: "sample-attachment"
182 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/...
183
184@@ -411,13 +411,13 @@
185 ... what_changed='security_related',
186 ... old_value=attachment, new_value=None)
187
188- >>> print pretty(attachment_change.getBugActivity())
189+ >>> print(pretty(attachment_change.getBugActivity()))
190 {'newvalue': None,
191 'oldvalue':
192 u'sample-attachment http://bugs.launchpad.dev/bugs/...+files/...',
193 'whatchanged': 'attachment removed'}
194
195- >>> print attachment_change.getBugNotification()['text']
196+ >>> print(attachment_change.getBugNotification()['text'])
197 ** Attachment removed: "sample-attachment"
198 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/...
199
200@@ -450,13 +450,13 @@
201 ... new_value=BugTaskStatus.FIXRELEASED,
202 ... bug_task=example_bug_task)
203
204- >>> print task_attribute_change.display_activity_label
205+ >>> print(task_attribute_change.display_activity_label)
206 status
207- >>> print task_attribute_change.display_notification_label
208+ >>> print(task_attribute_change.display_notification_label)
209 Status
210- >>> print task_attribute_change.display_old_value
211+ >>> print(task_attribute_change.display_old_value)
212 New
213- >>> print task_attribute_change.display_new_value
214+ >>> print(task_attribute_change.display_new_value)
215 Fix Released
216
217 Several types of attribute change can be handled by
218@@ -475,13 +475,13 @@
219 ... bug_task=example_bug_task, when=nowish, person=example_person,
220 ... what_changed='status', old_value=BugTaskStatus.NEW,
221 ... new_value=BugTaskStatus.FIXRELEASED)
222- >>> print pretty(status_change.getBugActivity())
223+ >>> print(pretty(status_change.getBugActivity()))
224 {'newvalue': 'Fix Released',
225 'oldvalue': 'New',
226 'whatchanged': u'heart-of-gold: status'}
227
228 >>> notification_text = status_change.getBugNotification()['text']
229- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
230+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
231 ** Changed in: heart-of-gold
232 Status: New => Fix Released
233
234@@ -499,13 +499,13 @@
235 ... what_changed='importance',
236 ... old_value=BugTaskImportance.UNDECIDED,
237 ... new_value=BugTaskImportance.CRITICAL)
238- >>> print pretty(importance_change.getBugActivity())
239+ >>> print(pretty(importance_change.getBugActivity()))
240 {'newvalue': 'Critical',
241 'oldvalue': 'Undecided',
242 'whatchanged': u'heart-of-gold: importance'}
243
244 >>> notification_text = importance_change.getBugNotification()['text']
245- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
246+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
247 ** Changed in: heart-of-gold
248 Importance: Undecided => Critical
249
250@@ -526,13 +526,13 @@
251 ... bug_task=example_bug_task, when=nowish,
252 ... person=example_person, what_changed='milestone',
253 ... old_value=None, new_value=milestone)
254- >>> print pretty(milestone_change.getBugActivity())
255+ >>> print(pretty(milestone_change.getBugActivity()))
256 {'newvalue': u'example-milestone',
257 'oldvalue': None,
258 'whatchanged': u'heart-of-gold: milestone'}
259
260 >>> notification_text = milestone_change.getBugNotification()['text']
261- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
262+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
263 ** Changed in: heart-of-gold
264 Milestone: None => example-milestone
265
266@@ -555,13 +555,13 @@
267 ... bug_task=example_bug_task, when=nowish,
268 ... person=example_person, what_changed='bugwatch',
269 ... old_value=None, new_value=bug_watch)
270- >>> print pretty(bug_watch_change.getBugActivity())
271+ >>> print(pretty(bug_watch_change.getBugActivity()))
272 {'newvalue': u'bugs.example.com/ #1245',
273 'oldvalue': None,
274 'whatchanged': u'heart-of-gold: remote watch'}
275
276 >>> notification_text = bug_watch_change.getBugNotification()['text']
277- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
278+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
279 ** Changed in: heart-of-gold
280 Remote watch: None => bugs.example.com/ #1245
281
282@@ -578,13 +578,13 @@
283 ... bug_task=example_bug_task, when=nowish,
284 ... person=example_person, what_changed='assignee',
285 ... old_value=None, new_value=example_person)
286- >>> print pretty(assignee_change.getBugActivity())
287+ >>> print(pretty(assignee_change.getBugActivity()))
288 {'newvalue': u'Ford Prefect (ford-prefect)',
289 'oldvalue': None,
290 'whatchanged': u'heart-of-gold: assignee'}
291
292 >>> notification_text = assignee_change.getBugNotification()['text']
293- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
294+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
295 ** Changed in: heart-of-gold
296 Assignee: (unassigned) => Ford Prefect (ford-prefect)
297
298@@ -605,11 +605,11 @@
299 ... what_changed='target',
300 ... old_value=example_bug_task.target,
301 ... new_value=new_target)
302- >>> print pretty(target_change.getBugActivity())
303+ >>> print(pretty(target_change.getBugActivity()))
304 {'newvalue': u'magrathea',
305 'oldvalue': u'heart-of-gold',
306 'whatchanged': 'affects'}
307
308 >>> notification_text = target_change.getBugNotification()['text']
309- >>> print notification_text #doctest: -NORMALIZE_WHITESPACE
310+ >>> print(notification_text) #doctest: -NORMALIZE_WHITESPACE
311 ** Project changed: heart-of-gold => magrathea
312
313=== modified file 'lib/lp/bugs/doc/bug-reported-acknowledgement.txt'
314--- lib/lp/bugs/doc/bug-reported-acknowledgement.txt 2011-05-05 05:46:41 +0000
315+++ lib/lp/bugs/doc/bug-reported-acknowledgement.txt 2018-06-30 11:02:51 +0000
316@@ -34,17 +34,17 @@
317 DistroSeries and SourcePackages defer to the Distribution:
318
319 >>> distro_series = distribution.getSeries('warty')
320- >>> print distro_series.bug_reported_acknowledgement
321+ >>> print(distro_series.bug_reported_acknowledgement)
322 Bug reported on Ubuntu.
323
324 >>> source_package = distro_series.getSourcePackage('alsa-utils')
325- >>> print source_package.bug_reported_acknowledgement
326+ >>> print(source_package.bug_reported_acknowledgement)
327 Bug reported on Ubuntu.
328
329 ProductSeries defer to the Product:
330
331 >>> product_series = product.getSeries('trunk')
332- >>> print product_series.bug_reported_acknowledgement
333+ >>> print(product_series.bug_reported_acknowledgement)
334 Bug reported on Mozilla Firefox.
335
336 One day these objects that defer bug_reported_acknowledgement may have
337@@ -81,7 +81,7 @@
338 ... "%s let %s have access." % (
339 ... context.displayname,
340 ... getUtility(ILaunchBag).user.displayname))
341- ... print context.bug_reported_acknowledgement
342+ ... print(context.bug_reported_acknowledgement)
343
344 >>> check_access("no-priv@canonical.com", distribution)
345 Traceback (most recent call last):
346
347=== modified file 'lib/lp/bugs/doc/bug-reporting-guidelines.txt'
348--- lib/lp/bugs/doc/bug-reporting-guidelines.txt 2011-05-05 05:46:41 +0000
349+++ lib/lp/bugs/doc/bug-reporting-guidelines.txt 2018-06-30 11:02:51 +0000
350@@ -33,17 +33,17 @@
351 DistroSeries and SourcePackages defer to the Distribution:
352
353 >>> distro_series = distribution.getSeries('warty')
354- >>> print distro_series.bug_reporting_guidelines
355+ >>> print(distro_series.bug_reporting_guidelines)
356 Welcome to Ubuntu!
357
358 >>> source_package = distro_series.getSourcePackage('alsa-utils')
359- >>> print source_package.bug_reporting_guidelines
360+ >>> print(source_package.bug_reporting_guidelines)
361 Welcome to Ubuntu!
362
363 ProductSeries defer to the Product:
364
365 >>> product_series = product.getSeries('trunk')
366- >>> print product_series.bug_reporting_guidelines
367+ >>> print(product_series.bug_reporting_guidelines)
368 Welcome to Mozilla Firefox!
369
370 One day these objects that defer bug_reporting_guidelines may have
371@@ -80,7 +80,7 @@
372 ... "%s let %s have access." % (
373 ... context.displayname,
374 ... getUtility(ILaunchBag).user.displayname))
375- ... print context.bug_reporting_guidelines
376+ ... print(context.bug_reporting_guidelines)
377
378 >>> check_access("no-priv@canonical.com", distribution)
379 Traceback (most recent call last):
380
381=== modified file 'lib/lp/bugs/doc/bug-tags.txt'
382--- lib/lp/bugs/doc/bug-tags.txt 2012-12-10 13:43:47 +0000
383+++ lib/lp/bugs/doc/bug-tags.txt 2018-06-30 11:02:51 +0000
384@@ -25,7 +25,7 @@
385 >>> from lp.bugs.model.bug import BugTag
386 >>> bugtags = BugTag.selectBy(bugID=bug_one.id, orderBy='tag')
387 >>> for bugtag in bugtags:
388- ... print bugtag.tag
389+ ... print(bugtag.tag)
390 sco
391 svg
392
393@@ -38,7 +38,7 @@
394
395 >>> bugtags = BugTag.selectBy(bugID=bug_one.id, orderBy='tag')
396 >>> for bugtag in bugtags:
397- ... print bugtag.tag
398+ ... print(bugtag.tag)
399 installl
400 sco
401 svg
402@@ -58,7 +58,7 @@
403
404 >>> bugtags = BugTag.selectBy(bugID=bug_one.id, orderBy='tag')
405 >>> for bugtag in bugtags:
406- ... print bugtag.tag
407+ ... print(bugtag.tag)
408 install
409 sco
410
411@@ -119,7 +119,7 @@
412 ...
413 WidgetInputError...
414
415- >>> print tags_widget._error.doc()
416+ >>> print(tags_widget._error.doc())
417 &#x27;!!!!&#x27; isn&#x27;t a valid tag name. Tags must start with a
418 letter or number and be lowercase. The characters &quot;+&quot;,
419 &quot;-&quot; and &quot;.&quot; are also allowed after the first
420@@ -179,9 +179,9 @@
421 _tagsFromFieldValue() converts tags from the field value to tags for
422 display. The absense of tags causes it to return None:
423
424- >>> print tags_frozen_set_widget._tagsFromFieldValue(None)
425+ >>> print(tags_frozen_set_widget._tagsFromFieldValue(None))
426 None
427- >>> print tags_frozen_set_widget._tagsFromFieldValue(frozenset())
428+ >>> print(tags_frozen_set_widget._tagsFromFieldValue(frozenset()))
429 None
430
431 Tags are ordered before returning:
432@@ -210,7 +210,7 @@
433
434 A regular BugTagsWidget is rendered as an <input> tag,
435
436- >>> print tags_widget()
437+ >>> print(tags_widget())
438 <input...type="text"...
439
440 A LargeBugTagsWidget is rendered as a <textarea>,
441@@ -218,7 +218,7 @@
442 >>> from lp.bugs.browser.widgets.bug import LargeBugTagsWidget
443 >>> large_text_widget = LargeBugTagsWidget(
444 ... bug_tags_field, tag_field, request)
445- >>> print large_text_widget()
446+ >>> print(large_text_widget())
447 <textarea...
448
449
450@@ -234,7 +234,7 @@
451 >>> svg_tasks = ubuntu.searchTasks(
452 ... BugTaskSearchParams(tag=all(u'svg'), user=None))
453 >>> for bugtask in svg_tasks:
454- ... print bugtask.bug.id, bugtask.bug.tags
455+ ... print(bugtask.bug.id, bugtask.bug.tags)
456 1 [u'sco', u'svg']
457
458 We can also search for bugs with any of the tags in a supplied list.
459@@ -243,7 +243,7 @@
460 >>> crash_dataloss_tasks = ubuntu.searchTasks(BugTaskSearchParams(
461 ... tag=any(u'crash', u'dataloss'), orderby='id', user=None))
462 >>> for bugtask in crash_dataloss_tasks:
463- ... print bugtask.bug.id, bugtask.bug.tags
464+ ... print(bugtask.bug.id, bugtask.bug.tags)
465 2 [u'dataloss', u'pebcak']
466 9 [u'crash']
467 10 [u'crash']
468@@ -255,7 +255,7 @@
469 >>> crash_burn_tasks = ubuntu.searchTasks(BugTaskSearchParams(
470 ... tag=all(u'crash', u'burn'), orderby='id', user=None))
471 >>> for bugtask in crash_burn_tasks:
472- ... print bugtask.bug.id, bugtask.bug.tags
473+ ... print(bugtask.bug.id, bugtask.bug.tags)
474 10 [u'burn', u'crash']
475 >>> getUtility(IBugSet).get(10).tags = [u'crash']
476
477@@ -280,7 +280,7 @@
478 XXX some_tag_tasks = ubuntu.searchTasks(
479 ... BugTaskSearchParams(searchtext=u'some-tag', user=None))
480 XXX for bugtask in some_tag_tasks:
481- ... print bugtask.id, bugtask.bug.id, bugtask.bug.tags
482+ ... print(bugtask.id, bugtask.bug.id, bugtask.bug.tags)
483 1 [u'some-tag']
484
485
486
487=== modified file 'lib/lp/bugs/doc/bug-watch-activity.txt'
488--- lib/lp/bugs/doc/bug-watch-activity.txt 2013-06-20 05:50:00 +0000
489+++ lib/lp/bugs/doc/bug-watch-activity.txt 2018-06-30 11:02:51 +0000
490@@ -21,7 +21,7 @@
491
492 When a BugWatch is first created there has been no activity on it.
493
494- >>> print bug_watch.activity.count()
495+ >>> print(bug_watch.activity.count())
496 0
497
498 >>> bug_watch.addActivity()
499@@ -31,7 +31,7 @@
500 We can access the BugWatchActivity record by looking at the BugWatch's
501 activity property.
502
503- >>> print bug_watch.activity.count()
504+ >>> print(bug_watch.activity.count())
505 1
506
507 >>> activity = bug_watch.activity.first()
508@@ -46,15 +46,15 @@
509
510 The BugWatchActivity's result will be BugWatchActivityStatus.SYNC_SUCCEEDED.
511
512- >>> print activity.result.title
513+ >>> print(activity.result.title)
514 Synchronisation succeeded
515
516 The other fields on the BugWatchActivity record, which aren't required,
517 will all be None.
518
519- >>> print activity.message
520+ >>> print(activity.message)
521 None
522- >>> print activity.oops_id
523+ >>> print(activity.oops_id)
524 None
525
526
527@@ -77,7 +77,7 @@
528 An extra activity item will have been added to the BugWatch's activity
529 property.
530
531- >>> print bug_watch.activity.count()
532+ >>> print(bug_watch.activity.count())
533 2
534
535 The most recent activity entry will have a result of
536@@ -85,17 +85,17 @@
537 successful.
538
539 >>> most_recent_activity = bug_watch.activity.first()
540- >>> print most_recent_activity.result.title
541+ >>> print(most_recent_activity.result.title)
542 Synchronisation succeeded
543
544 Its message will also be empty
545
546- >>> print most_recent_activity.message
547+ >>> print(most_recent_activity.message)
548 None
549
550 As will its oops_id
551
552- >>> print most_recent_activity.oops_id
553+ >>> print(most_recent_activity.oops_id)
554 None
555
556 If the remote bug tracker breaks during an update the error will be
557@@ -111,19 +111,19 @@
558
559 Another entry will have been added to the watch's activity property.
560
561- >>> print bug_watch.activity.count()
562+ >>> print(bug_watch.activity.count())
563 3
564
565 And this time its result field will record that the remote bug was
566 not found.
567
568 >>> most_recent_activity = bug_watch.activity.first()
569- >>> print most_recent_activity.result.title
570+ >>> print(most_recent_activity.result.title)
571 Unparsable Bug
572
573 The OOPS ID for the error will also have been recorded.
574
575- >>> print most_recent_activity.oops_id
576+ >>> print(most_recent_activity.oops_id)
577 OOPS...
578
579 The CheckwatchesMaster also adds BugWatchActivity entries when errors occur
580@@ -133,10 +133,10 @@
581 >>> updater.updateBugWatches(broken_bugtracker, [bug_watch])
582 >>> most_recent_activity = bug_watch.activity.first()
583
584- >>> print most_recent_activity.result.title
585+ >>> print(most_recent_activity.result.title)
586 Unknown
587
588 The OOPS ID of the error is recorded so that we can debug it.
589
590- >>> print most_recent_activity.oops_id
591+ >>> print(most_recent_activity.oops_id)
592 OOPS...
593
594=== modified file 'lib/lp/bugs/doc/bug.txt'
595--- lib/lp/bugs/doc/bug.txt 2016-01-26 15:47:37 +0000
596+++ lib/lp/bugs/doc/bug.txt 2018-06-30 11:02:51 +0000
597@@ -17,13 +17,13 @@
598 To retrieve a specific Bug, use IBugSet.get:
599
600 >>> firefox_crashes = bugset.get(6)
601- >>> print firefox_crashes.title
602+ >>> print(firefox_crashes.title)
603 Firefox crashes when Save As dialog for a nonexistent window is closed
604
605 Or you can use IBugSet.getByNameOrID to get it by its nickname:
606
607 >>> blackhole_bug = bugset.getByNameOrID('blackhole')
608- >>> print blackhole_bug.title
609+ >>> print(blackhole_bug.title)
610 Blackhole Trash folder
611
612 If the bug can't be found, a zope.exceptions.NotFoundError will be
613@@ -37,7 +37,7 @@
614 >>> bugset.getByNameOrID('+bugs')
615 Traceback (most recent call last):
616 ...
617- NotFoundError: 'Unable to locate bug with nickname +bugs.'
618+ NotFoundError: u'Unable to locate bug with nickname +bugs.'
619
620 It is also possible to retrieve a number of bugs by specifying the bug numbers
621 of interest.
622@@ -46,28 +46,28 @@
623 result set below has only one element.
624
625 >>> result_set = bugset.getByNumbers([6, 1234])
626- >>> print result_set.count()
627+ >>> print(result_set.count())
628 1
629
630 >>> [the_bug_found] = result_set
631- >>> print the_bug_found.title
632+ >>> print(the_bug_found.title)
633 Firefox crashes when Save As dialog for a nonexistent window is closed
634
635 >>> result_set = bugset.getByNumbers([6, 1])
636- >>> print result_set.count()
637+ >>> print(result_set.count())
638 2
639
640- >>> print [(bug.id, bug.title[:40]) for bug in result_set]
641+ >>> print([(bug.id, bug.title[:40]) for bug in result_set])
642 [(1, u'Firefox does not support SVG'),
643 (6, u'Firefox crashes when Save As dialog for ')]
644
645 If no bug numbers are specified an empty result set is returned.
646
647 >>> result_set = bugset.getByNumbers(None)
648- >>> print result_set.count()
649+ >>> print(result_set.count())
650 0
651 >>> result_set = bugset.getByNumbers([])
652- >>> print result_set.count()
653+ >>> print(result_set.count())
654 0
655
656 Bug creation events
657@@ -80,9 +80,9 @@
658 >>> from lazr.lifecycle.event import IObjectCreatedEvent
659
660 >>> def show_bug_creation_event(bug, event):
661- ... print "New bug created: %s" % (bug.title,)
662- ... print " Owner: %s" % (bug.owner.name,)
663- ... print " Filed by: %s" % (event.user.name,)
664+ ... print("New bug created: %s" % (bug.title,))
665+ ... print(" Owner: %s" % (bug.owner.name,))
666+ ... print(" Filed by: %s" % (event.user.name,))
667
668 >>> globalSiteManager.registerHandler(
669 ... show_bug_creation_event, (IBug, IObjectCreatedEvent))
670@@ -150,7 +150,7 @@
671
672 >>> from lp.services.webapp import canonical_url
673 >>> login(ANONYMOUS)
674- >>> print canonical_url(firefox_crashes)
675+ >>> print(canonical_url(firefox_crashes))
676 http://.../bugs/6
677
678
679@@ -189,7 +189,7 @@
680
681 There are currently no people subscribed to this bug:
682
683- >>> print firefox_crashes.subscriptions.count()
684+ >>> print(firefox_crashes.subscriptions.count())
685 0
686
687 The rule with private bugs is that only direct subscribers can view the
688@@ -391,21 +391,21 @@
689 So, let's continue:
690
691 >>> for subscription in public_bug.subscriptions:
692- ... print subscription.person.name
693+ ... print(subscription.person.name)
694 name16
695
696 The first comment made (this is submitted in the bug report) is set to
697 the description of the bug:
698
699- >>> print public_bug.description
700+ >>> print(public_bug.description)
701 blah blah blah
702
703 The bug description can also be accessed through the task:
704
705- >>> print public_bug.bugtasks[0].bug.description
706+ >>> print(public_bug.bugtasks[0].bug.description)
707 blah blah blah
708 >>> public_bug.description = 'a new description'
709- >>> print public_bug.bugtasks[0].bug.description
710+ >>> print(public_bug.bugtasks[0].bug.description)
711 a new description
712
713 When a private bug is filed:
714@@ -534,12 +534,12 @@
715
716 >>> firefox_task = firefox_bug.bugtasks[0]
717
718- >>> print firefox_task.bugtargetdisplayname
719+ >>> print(firefox_task.bugtargetdisplayname)
720 Mozilla Firefox
721
722- >>> print firefox_task.importance.title
723+ >>> print(firefox_task.importance.title)
724 Undecided
725- >>> print firefox_task.status.title
726+ >>> print(firefox_task.status.title)
727 New
728
729 >>> bugtask_before_modification = Snapshot(
730@@ -567,7 +567,7 @@
731
732 >>> thunderbird = productset.getByName("thunderbird")
733
734- >>> print thunderbird.name
735+ >>> print(thunderbird.name)
736 thunderbird
737
738 >>> thunderbird_task = getUtility(IBugTaskSet).createTask(
739@@ -603,7 +603,7 @@
740 ... owner=foobar, target=ubuntu)
741 >>> notify(ObjectCreatedEvent(ubuntu_task))
742
743- >>> print ubuntu_task.distribution.title
744+ >>> print(ubuntu_task.distribution.title)
745 Ubuntu
746
747 And for a specific distribution series.
748@@ -613,7 +613,7 @@
749 ... owner=foobar, target=warty)
750 >>> notify(ObjectCreatedEvent(warty_task))
751
752- >>> print warty_task.distroseries.title
753+ >>> print(warty_task.distroseries.title)
754 The Warty Warthog Release
755
756 Also for a specific distribution source package.
757@@ -624,7 +624,7 @@
758 ... owner=foobar, target=linux_source)
759 >>> notify(ObjectCreatedEvent(linux_task))
760
761- >>> print linux_task.bugtargetname
762+ >>> print(linux_task.bugtargetname)
763 linux-source-2.6.15 (Tubuntu)
764
765 And for a distro series source package.
766@@ -638,20 +638,20 @@
767 ... owner=foobar, target=warty_fox_package)
768 >>> notify(ObjectCreatedEvent(warty_fox_task))
769
770- >>> print warty_fox_task.bugtargetname
771+ >>> print(warty_fox_task.bugtargetname)
772 mozilla-firefox (Ubuntu Warty)
773
774- >>> print warty_fox_task.distroseries.name
775+ >>> print(warty_fox_task.distroseries.name)
776 warty
777
778- >>> print warty_fox_task.sourcepackagename.name
779+ >>> print(warty_fox_task.sourcepackagename.name)
780 mozilla-firefox
781
782 The first task is available as default_bugtask. Launchpad often views
783 bugs in the context of a bugtask, and the default choice is the first
784 or oldest bugtask.
785
786- >>> print firefox_bug.default_bugtask.bugtargetdisplayname
787+ >>> print(firefox_bug.default_bugtask.bugtargetdisplayname)
788 Mozilla Firefox
789
790 Changing bug visibility.
791@@ -696,7 +696,7 @@
792
793 >>> bug_before_modification = Snapshot(firefox_bug, providing=IBug)
794
795- >>> print firefox_bug.duplicateof
796+ >>> print(firefox_bug.duplicateof)
797 None
798 >>> firefox_bug.markAsDuplicate(factory.makeBug())
799
800@@ -812,7 +812,7 @@
801 >>> bugwatch_before_modification = Snapshot(
802 ... bugwatch, providing=IBugWatch)
803
804- >>> print bugwatch.remotebug
805+ >>> print(bugwatch.remotebug)
806 1234
807
808 >>> bugwatch.remotebug = '5678'
809@@ -839,7 +839,7 @@
810 ... )
811
812 >>> imported_message = bugwatch.getImportedBugMessages()[0]
813- >>> print imported_message.message.text_contents
814+ >>> print(imported_message.message.text_contents)
815 blah blah blah blah remotely
816
817 Subscribing and unsubscribing does *not* trigger an update of
818@@ -889,7 +889,7 @@
819 incomplete, and show the status of each of the tasts:
820
821 >>> for task in b8.bugtasks:
822- ... print task.bugtargetdisplayname, task.is_complete
823+ ... print(task.bugtargetdisplayname, task.is_complete)
824 Mozilla Firefox False
825 mozilla-firefox (Debian) True
826
827@@ -904,7 +904,7 @@
828 You can get the set of bugtasks for at bug with the 'bugtasks' attribute:
829
830 >>> bug_two = bugset.get(2)
831- >>> for task in bug_two.bugtasks: print task.target.displayname
832+ >>> for task in bug_two.bugtasks: print(task.target.displayname)
833 Tomcat
834 Ubuntu
835 Hoary
836@@ -914,7 +914,7 @@
837 You can also get a list of the "LP pillars" affected by a particular bug.
838
839 >>> for pillar in bug_two.affected_pillars:
840- ... print pillar.displayname
841+ ... print(pillar.displayname)
842 Tomcat
843 Ubuntu
844 Debian
845@@ -1087,9 +1087,9 @@
846 exported using the webservice API.
847
848 >>> for indexed_message in bug_two.indexed_messages:
849- ... print '%s\t%s\t%s' % (
850+ ... print('%s\t%s\t%s' % (
851 ... indexed_message.index, indexed_message.subject,
852- ... indexed_message.inside.title)
853+ ... indexed_message.inside.title))
854 0 PEBCAK
855 Bug #2 in Tomcat: "Blackhole Trash folder"
856 1 Fantastic idea, I'd really like to see this
857@@ -1114,13 +1114,13 @@
858 including the anonymous user, are neither marked as affected nor as
859 unaffected.
860
861- >>> print test_bug.isUserAffected(test_bug.owner)
862+ >>> print(test_bug.isUserAffected(test_bug.owner))
863 True
864
865- >>> print test_bug.isUserAffected(affected_user)
866+ >>> print(test_bug.isUserAffected(affected_user))
867 None
868
869- >>> print test_bug.isUserAffected(None)
870+ >>> print(test_bug.isUserAffected(None))
871 None
872
873 When we mark a bug as affecting a new user, the affected_users_count
874@@ -1141,7 +1141,7 @@
875
876 We can mark a user as unaffected by a bug.
877
878- >>> print test_bug.isUserAffected(unaffected_user)
879+ >>> print(test_bug.isUserAffected(unaffected_user))
880 None
881 >>> test_bug.markUserAffected(unaffected_user, affected=False)
882 >>> test_bug.isUserAffected(unaffected_user)
883@@ -1168,19 +1168,19 @@
884
885 We can also get the collection of users affected by a bug.
886
887- >>> print '\n'.join(
888- ... sorted(user.name for user in test_bug.users_affected))
889+ >>> print('\n'.join(
890+ ... sorted(user.name for user in test_bug.users_affected)))
891 bruce-dickinson
892 paul-dianno
893
894 >>> unaffecting_bug = factory.makeBug()
895- >>> print list(unaffecting_bug.users_affected)
896+ >>> print(list(unaffecting_bug.users_affected))
897 [<Person at ...>]
898
899 Similarly, we can get the collection of users unaffected by a bug.
900
901- >>> print '\n'.join(
902- ... sorted(user.name for user in test_bug.users_unaffected))
903+ >>> print('\n'.join(
904+ ... sorted(user.name for user in test_bug.users_unaffected)))
905 blaze-bayley
906
907 If a user is marked as being affected by a bug (either by explicitly
908@@ -1196,8 +1196,8 @@
909
910 And the list of users the master bug affects includes that user.
911
912- >>> print '\n'.join(
913- ... sorted(user.name for user in test_bug.users_affected_with_dupes))
914+ >>> print('\n'.join(
915+ ... sorted(user.name for user in test_bug.users_affected_with_dupes)))
916 bruce-dickinson
917 paul-dianno
918 sheila-shakespeare
919@@ -1213,8 +1213,8 @@
920 And the list of users that the master bug affects still includes the
921 user, of course.
922
923- >>> print '\n'.join(
924- ... sorted(user.name for user in test_bug.users_affected_with_dupes))
925+ >>> print('\n'.join(
926+ ... sorted(user.name for user in test_bug.users_affected_with_dupes)))
927 bruce-dickinson
928 paul-dianno
929 sheila-shakespeare
930@@ -1240,18 +1240,18 @@
931
932 Both duplicates claim to affect just that user:
933
934- >>> print '\n'.join(
935- ... sorted(user.name for user in dupe_one.users_affected))
936+ >>> print('\n'.join(
937+ ... sorted(user.name for user in dupe_one.users_affected)))
938 sheila-shakespeare
939- >>> print '\n'.join(
940- ... sorted(user.name for user in dupe_two.users_affected))
941+ >>> print('\n'.join(
942+ ... sorted(user.name for user in dupe_two.users_affected)))
943 sheila-shakespeare
944
945 And the list of users that the master bug affects includes the user
946 exactly once, of course.
947
948- >>> print '\n'.join(
949- ... sorted(user.name for user in test_bug.users_affected_with_dupes))
950+ >>> print('\n'.join(
951+ ... sorted(user.name for user in test_bug.users_affected_with_dupes)))
952 bruce-dickinson
953 napoleon-bonaparte
954 paul-dianno
955@@ -1277,26 +1277,26 @@
956 The dup user no longer appears as affected by the master bug nor
957 either of the dups:
958
959- >>> print '\n'.join(
960- ... sorted(user.name for user in test_bug.users_affected_with_dupes))
961+ >>> print('\n'.join(
962+ ... sorted(user.name for user in test_bug.users_affected_with_dupes)))
963 bruce-dickinson
964 napoleon-bonaparte
965 paul-dianno
966- >>> print '\n'.join(
967- ... sorted(user.name for user in dupe_one.users_affected))
968+ >>> print('\n'.join(
969+ ... sorted(user.name for user in dupe_one.users_affected)))
970 <BLANKLINE>
971- >>> print '\n'.join(
972- ... sorted(user.name for user in dupe_two.users_affected))
973+ >>> print('\n'.join(
974+ ... sorted(user.name for user in dupe_two.users_affected)))
975 <BLANKLINE>
976
977 Since the user who filed the first two dups had an entry explicitly
978 saying they were affected, they now claim that they are unaffected.
979
980- >>> print '\n'.join(
981- ... sorted(user.name for user in dupe_one.users_unaffected))
982+ >>> print('\n'.join(
983+ ... sorted(user.name for user in dupe_one.users_unaffected)))
984 sheila-shakespeare
985- >>> print '\n'.join(
986- ... sorted(user.name for user in dupe_two.users_unaffected))
987+ >>> print('\n'.join(
988+ ... sorted(user.name for user in dupe_two.users_unaffected)))
989 sheila-shakespeare
990
991 But they didn't file the third dup, so there was never any explicit
992@@ -1304,16 +1304,16 @@
993 as explicitly unaffected, even after marking the master bug as not
994 affecting them.
995
996- >>> print '\n'.join(
997- ... sorted(user.name for user in dupe_three.users_unaffected))
998+ >>> print('\n'.join(
999+ ... sorted(user.name for user in dupe_three.users_unaffected)))
1000 <BLANKLINE>
1001
1002 However, if a dup was not marked either way for that user, then do
1003 nothing to the dup when the master is marked as not affecting the
1004 user.
1005
1006- >>> print '\n'.join(
1007- ... sorted(user.name for user in dupe_three.users_affected))
1008+ >>> print('\n'.join(
1009+ ... sorted(user.name for user in dupe_three.users_affected)))
1010 napoleon-bonaparte
1011
1012
1013@@ -1338,7 +1338,7 @@
1014 ... bug_tasks, user=sample_person)
1015 >>> bugs = sorted(bugs, key=attrgetter('title'))
1016 >>> for bug in bugs:
1017- ... print bug.title
1018+ ... print(bug.title)
1019 New bug 0
1020 New bug 1
1021 New bug 2
1022@@ -1356,12 +1356,12 @@
1023 >>> len(matching_bugs)
1024 1
1025
1026- >>> print matching_bugs[0].title
1027+ >>> print(matching_bugs[0].title)
1028 New bug 0
1029
1030 >>> for task in sorted(matching_bugs[0].bugtasks,
1031 ... key=attrgetter('bugtargetname')):
1032- ... print task.bugtargetname
1033+ ... print(task.bugtargetname)
1034 firefox
1035 thunderbird
1036
1037@@ -1377,7 +1377,7 @@
1038 ... bug_tasks, user=no_priv)
1039
1040 >>> for bug in sorted(matching_bugs, key=attrgetter('title')):
1041- ... print bug.title
1042+ ... print(bug.title)
1043 New bug 0
1044 New bug 1
1045 New bug 3
1046@@ -1394,7 +1394,7 @@
1047 ... bug_tasks, user=no_priv)
1048
1049 >>> for bug in sorted(matching_bugs, key=attrgetter('title')):
1050- ... print bug.title
1051+ ... print(bug.title)
1052 New bug 0
1053 New bug 1
1054 New bug 4
1055@@ -1409,7 +1409,7 @@
1056 ... bug_tasks, user=no_priv)
1057
1058 >>> for bug in sorted(matching_bugs, key=attrgetter('title')):
1059- ... print bug.title
1060+ ... print(bug.title)
1061 New bug 0
1062 New bug 1
1063
1064@@ -1419,7 +1419,7 @@
1065 >>> matching_bugs = getUtility(IBugSet).getDistinctBugsForBugTasks(
1066 ... bug_tasks, user=no_priv, limit=1)
1067 >>> for bug in sorted(matching_bugs, key=attrgetter('title')):
1068- ... print bug.title
1069+ ... print(bug.title)
1070 New bug 0
1071
1072
1073@@ -1438,7 +1438,7 @@
1074 Bug.getHWSubmissions() returns the HWDB submissions linked to a bug.
1075
1076 >>> for submission in test_bug.getHWSubmissions():
1077- ... print submission.submission_key
1078+ ... print(submission.submission_key)
1079 sample-submission
1080
1081 Private submissions are only included if the current user is an admin
1082@@ -1449,12 +1449,12 @@
1083 ... submission_key='private-submission')
1084 >>> test_bug.linkHWSubmission(private_submission)
1085 >>> for submission in test_bug.getHWSubmissions(user=sample_person):
1086- ... print submission.submission_key
1087+ ... print(submission.submission_key)
1088 private-submission
1089 sample-submission
1090
1091 >>> for submission in test_bug.getHWSubmissions(user=foobar):
1092- ... print submission.submission_key
1093+ ... print(submission.submission_key)
1094 private-submission
1095 sample-submission
1096
1097@@ -1462,17 +1462,17 @@
1098
1099 >>> no_priv = personset.getByEmail('no-priv@canonical.com')
1100 >>> for submission in test_bug.getHWSubmissions(user=no_priv):
1101- ... print submission.submission_key
1102+ ... print(submission.submission_key)
1103 sample-submission
1104
1105 >>> for submission in test_bug.getHWSubmissions():
1106- ... print submission.submission_key
1107+ ... print(submission.submission_key)
1108 sample-submission
1109
1110 We can also delete links between a HWDB submission and a bug.
1111
1112 >>> test_bug.unlinkHWSubmission(submission)
1113- >>> print test_bug.getHWSubmissions().count()
1114+ >>> print(test_bug.getHWSubmissions().count())
1115 0
1116
1117
1118@@ -1567,9 +1567,9 @@
1119 If a bug has no attachments, both properties are None.
1120
1121 >>> bug = factory.makeBug()
1122- >>> print bug.latest_patch
1123+ >>> print(bug.latest_patch)
1124 None
1125- >>> print bug.latest_patch_uploaded
1126+ >>> print(bug.latest_patch_uploaded)
1127 None
1128
1129 If we add an attachment that is not a patch, the value of
1130@@ -1582,7 +1582,7 @@
1131 >>> attachment_1 = factory.makeBugAttachment(bug)
1132
1133 >>> transaction.commit()
1134- >>> print bug.latest_patch_uploaded
1135+ >>> print(bug.latest_patch_uploaded)
1136 None
1137
1138 If we declare the existing attachment to be a patch,
1139@@ -1594,9 +1594,9 @@
1140 >>> attachment_1.type = BugAttachmentType.PATCH
1141 >>> transaction.commit()
1142 >>> date_message_1_created = bug.attachments[0].message.datecreated
1143- >>> print bug.latest_patch == attachment_1
1144+ >>> print(bug.latest_patch == attachment_1)
1145 True
1146- >>> print bug.latest_patch_uploaded == date_message_1_created
1147+ >>> print(bug.latest_patch_uploaded == date_message_1_created)
1148 True
1149
1150 If we add another attachment, this time declared to be a patch
1151@@ -1607,9 +1607,9 @@
1152 >>> attachment_2 = factory.makeBugAttachment(bug, is_patch=True)
1153 >>> transaction.commit()
1154 >>> date_message_2_created = bug.attachments[1].message.datecreated
1155- >>> print bug.latest_patch == attachment_2
1156+ >>> print(bug.latest_patch == attachment_2)
1157 True
1158- >>> print bug.latest_patch_uploaded == date_message_2_created
1159+ >>> print(bug.latest_patch_uploaded == date_message_2_created)
1160 True
1161
1162 If we say that attachment_1 is not a patch, the values of
1163@@ -1617,9 +1617,9 @@
1164
1165 >>> attachment_1.type = BugAttachmentType.UNSPECIFIED
1166 >>> transaction.commit()
1167- >>> print bug.latest_patch == attachment_2
1168+ >>> print(bug.latest_patch == attachment_2)
1169 True
1170- >>> print bug.latest_patch_uploaded == date_message_2_created
1171+ >>> print(bug.latest_patch_uploaded == date_message_2_created)
1172 True
1173
1174 If we declare attachment_1 again to be a patch and if we delete
1175@@ -1629,9 +1629,9 @@
1176 >>> attachment_1.type = BugAttachmentType.PATCH
1177 >>> attachment_2.removeFromBug(user=bug.owner)
1178 >>> transaction.commit()
1179- >>> print bug.latest_patch == attachment_1
1180+ >>> print(bug.latest_patch == attachment_1)
1181 True
1182- >>> print bug.latest_patch_uploaded == date_message_1_created
1183+ >>> print(bug.latest_patch_uploaded == date_message_1_created)
1184 True
1185
1186 If we delete attachment_1 too, bug.latest_patch and
1187@@ -1639,7 +1639,7 @@
1188
1189 >>> attachment_1.removeFromBug(user=bug.owner)
1190 >>> transaction.commit()
1191- >>> print bug.latest_patch
1192+ >>> print(bug.latest_patch)
1193 None
1194- >>> print bug.latest_patch_uploaded
1195+ >>> print(bug.latest_patch_uploaded)
1196 None
1197
1198=== modified file 'lib/lp/bugs/doc/bugactivity.txt'
1199--- lib/lp/bugs/doc/bugactivity.txt 2012-10-10 03:12:08 +0000
1200+++ lib/lp/bugs/doc/bugactivity.txt 2018-06-30 11:02:51 +0000
1201@@ -115,7 +115,7 @@
1202 whenever necessary), it is normalized to show the actual attribute name.
1203 For instance, look at the attributes on the previous activity.
1204
1205- >>> print bug.activity[-2].target
1206+ >>> print(bug.activity[-2].target)
1207 None
1208 >>> bug.activity[-2].whatchanged
1209 u'summary'
1210@@ -237,14 +237,14 @@
1211 final_bug as their master bug.
1212
1213 >>> latest_activity = dupe_one.activity[-1]
1214- >>> print latest_activity.whatchanged
1215+ >>> print(latest_activity.whatchanged)
1216 changed duplicate marker
1217 >>> latest_activity.oldvalue == unicode(initial_bug.id)
1218 True
1219 >>> latest_activity.newvalue == unicode(final_bug.id)
1220 True
1221 >>> latest_activity = dupe_two.activity[-1]
1222- >>> print latest_activity.whatchanged
1223+ >>> print(latest_activity.whatchanged)
1224 changed duplicate marker
1225 >>> latest_activity.oldvalue == unicode(initial_bug.id)
1226 True
1227@@ -277,7 +277,7 @@
1228 activity sensibly in an HTML interface. In most cases it just returns
1229 activity.whatchanged.
1230
1231- >>> print activity_item.change_summary
1232+ >>> print(activity_item.change_summary)
1233 summary
1234
1235 Summary changes are represented as unified diffs in the interface, in
1236@@ -285,15 +285,15 @@
1237 properly in the UI, they're returned with newline characters replaces
1238 with HTML line-breaks.
1239
1240- >>> print activity_item.change_details
1241+ >>> print(activity_item.change_details)
1242 - Old value<br />+ New value
1243
1244 BugActivityItem delegates to IBugActivity, so we can still access the
1245 original BugActivity's properties if we want.
1246
1247- >>> print "%s: %s => %s" % (
1248+ >>> print("%s: %s => %s" % (
1249 ... activity_item.whatchanged, activity_item.oldvalue,
1250- ... activity_item.newvalue)
1251+ ... activity_item.newvalue))
1252 summary: Old value => New value
1253
1254 For simpler changes, activity_item.change_details will simply return the
1255@@ -306,7 +306,7 @@
1256 ... datechanged=nowish)
1257 >>> activity_item = BugActivityItem(activity)
1258
1259- >>> print activity_item.change_details
1260+ >>> print(activity_item.change_details)
1261 no &#8594; yes
1262
1263 >>> activity = getUtility(IBugActivitySet).new(
1264@@ -314,7 +314,7 @@
1265 ... newvalue='private', person=user, datechanged=nowish)
1266 >>> activity_item = BugActivityItem(activity)
1267
1268- >>> print activity_item.change_details
1269+ >>> print(activity_item.change_details)
1270 public &#8594; private
1271
1272 Tag changes use the _formatted_tags_change property of BugActivityItem
1273@@ -324,14 +324,14 @@
1274 ... bug=bug_one, whatchanged='tags', oldvalue='tag1 tag2',
1275 ... newvalue='tag1 tag3', person=user, datechanged=nowish)
1276 >>> activity_item = BugActivityItem(activity)
1277- >>> print activity_item._formatted_tags_change
1278+ >>> print(activity_item._formatted_tags_change)
1279 added: tag3
1280 removed: tag2
1281
1282 The change_details value for this change will be that returned by
1283 _formatted_tags_change but with newlines replaced by HTML line-breaks.
1284
1285- >>> print activity_item.change_details
1286+ >>> print(activity_item.change_details)
1287 added: tag3<br />removed: tag2
1288
1289 For changes to bug tasks, BugActivityItem returns the name of the attribute
1290@@ -343,12 +343,12 @@
1291 ... newvalue='Triaged', person=user, datechanged=nowish)
1292 >>> activity_item = BugActivityItem(activity)
1293
1294- >>> print activity_item.change_summary
1295+ >>> print(activity_item.change_summary)
1296 status
1297
1298 The change_details are expressed as a simple change.
1299
1300- >>> print activity_item.change_details
1301+ >>> print(activity_item.change_details)
1302 New &#8594; Triaged
1303
1304 For assignee changes, BugActivityItem will ensure that old or new values
1305@@ -358,7 +358,7 @@
1306 ... bug=bug_one, whatchanged='malone: assignee', oldvalue=None,
1307 ... newvalue='somebody', person=user, datechanged=nowish)
1308 >>> activity_item = BugActivityItem(activity)
1309- >>> print activity_item.change_details
1310+ >>> print(activity_item.change_details)
1311 nobody &#8594; somebody
1312
1313 >>> activity = getUtility(IBugActivitySet).new(
1314@@ -366,7 +366,7 @@
1315 ... oldvalue='somebody', newvalue=None, person=user,
1316 ... datechanged=nowish)
1317 >>> activity_item = BugActivityItem(activity)
1318- >>> print activity_item.change_details
1319+ >>> print(activity_item.change_details)
1320 somebody &#8594; nobody
1321
1322 For changes to a bug's description, we simply return the word 'updated,'
1323@@ -377,6 +377,6 @@
1324 ... oldvalue='Old description', newvalue='New description',
1325 ... person=user, datechanged=nowish)
1326 >>> activity_item = BugActivityItem(activity)
1327- >>> print "%s: %s" % (
1328- ... activity_item.change_summary, activity_item.change_details)
1329+ >>> print("%s: %s" % (
1330+ ... activity_item.change_summary, activity_item.change_details))
1331 description: updated
1332
1333=== modified file 'lib/lp/bugs/doc/bugattachments.txt'
1334--- lib/lp/bugs/doc/bugattachments.txt 2016-01-26 15:47:37 +0000
1335+++ lib/lp/bugs/doc/bugattachments.txt 2018-06-30 11:02:51 +0000
1336@@ -26,17 +26,17 @@
1337 To create an attachment, call IBug.addAttachment. It will emit an
1338 ObjectCreatedEvent in order to trigger email notifications:
1339
1340- >>> from StringIO import StringIO
1341+ >>> from io import BytesIO
1342
1343 >>> from lp.testing.event import TestEventListener
1344 >>> from lazr.lifecycle.event import IObjectCreatedEvent
1345 >>> def attachment_added(attachment, event):
1346- ... print "Attachment added: %r" % attachment.libraryfile.filename
1347+ ... print("Attachment added: %r" % attachment.libraryfile.filename)
1348 >>> event_listener = TestEventListener(
1349 ... IBugAttachment, IObjectCreatedEvent, attachment_added)
1350
1351- >>> filecontent = "Some useful information."
1352- >>> data = StringIO(filecontent)
1353+ >>> filecontent = b"Some useful information."
1354+ >>> data = BytesIO(filecontent)
1355
1356 >>> foobar = getUtility(IPersonSet).getByName("name16")
1357
1358@@ -82,7 +82,7 @@
1359
1360 If no description is given, the title is set to the filename.
1361
1362- >>> data = StringIO(filecontent)
1363+ >>> data = BytesIO(filecontent)
1364 >>> screenshot = bug_four.addAttachment(
1365 ... owner=foobar,
1366 ... data=data,
1367@@ -98,7 +98,7 @@
1368 >>> screenshot.libraryfile.mimetype
1369 u'image/jpeg'
1370
1371- >>> data = StringIO('</something-htmlish>')
1372+ >>> data = BytesIO(b'</something-htmlish>')
1373 >>> debdiff = bug_four.addAttachment(
1374 ... owner=foobar,
1375 ... data=data,
1376@@ -120,7 +120,7 @@
1377 >>> from lp.services.webapp.servers import LaunchpadTestRequest
1378
1379 >>> login('test@canonical.com')
1380- >>> filecontent = StringIO('')
1381+ >>> filecontent = BytesIO(b'')
1382 >>> filecontent.filename = 'foo.bar'
1383 >>> add_request = LaunchpadTestRequest(
1384 ... method="POST",
1385@@ -151,7 +151,7 @@
1386 testrunner is 1024, so let's create a file larger than that and try to
1387 upload it:
1388
1389- >>> filecontent = StringIO('x'*1025)
1390+ >>> filecontent = BytesIO(b'x'*1025)
1391 >>> filecontent.filename = 'foo.txt'
1392 >>> add_request = LaunchpadTestRequest(
1393 ... method="POST",
1394@@ -213,8 +213,8 @@
1395
1396 If the request contains no attachment description the filename should be used.
1397
1398- >>> filecontent = StringIO(
1399- ... "No, sir. That's one bonehead name, but that ain't me any more.")
1400+ >>> filecontent = BytesIO(
1401+ ... b"No, sir. That's one bonehead name, but that ain't me any more.")
1402 >>> filecontent.filename = 'RA.txt'
1403 >>> add_request = LaunchpadTestRequest(
1404 ... method="POST",
1405@@ -237,7 +237,7 @@
1406
1407 >>> from lp.bugs.model.bugnotification import BugNotification
1408 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
1409- >>> print latest_notification.message.text_contents
1410+ >>> print(latest_notification.message.text_contents)
1411 ** Attachment added: "RA.txt"
1412 http://.../RA.txt
1413
1414@@ -452,7 +452,7 @@
1415
1416 It's also possible to delete attachments.
1417
1418- >>> data = StringIO(filecontent)
1419+ >>> data = BytesIO(filecontent.getvalue())
1420 >>> bug_two = getUtility(IBugSet).get(2)
1421 >>> attachment = bug_two.addAttachment(
1422 ... owner=foobar,
1423@@ -462,7 +462,7 @@
1424 ... comment="a string comment",
1425 ... is_patch=False)
1426 >>> for attachment in bug_two.attachments:
1427- ... print attachment.title
1428+ ... print(attachment.title)
1429 Attachment to be deleted
1430
1431 >>> libraryfile = attachment.libraryfile
1432@@ -485,7 +485,7 @@
1433 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
1434 >>> latest_notification.is_comment
1435 False
1436- >>> print latest_notification.message.text_contents
1437+ >>> print(latest_notification.message.text_contents)
1438 ** Attachment removed: "Attachment to be deleted"
1439 http://.../foo.baz
1440
1441@@ -500,7 +500,7 @@
1442 0
1443 >>> attachment = bug_two.addAttachment(
1444 ... owner=foobar,
1445- ... data=StringIO(filecontent),
1446+ ... data=BytesIO(filecontent.getvalue()),
1447 ... filename="foo.baz",
1448 ... description="A non-patch attachment",
1449 ... comment="a string comment",
1450@@ -511,7 +511,7 @@
1451 False
1452 >>> attachment = bug_two.addAttachment(
1453 ... owner=foobar,
1454- ... data=StringIO(filecontent),
1455+ ... data=BytesIO(filecontent.getvalue()),
1456 ... filename="foo.baz",
1457 ... description="A patch attachment",
1458 ... comment="a string comment",
1459@@ -538,11 +538,11 @@
1460 >>> from lp.services.librarian.interfaces import (
1461 ... ILibraryFileAliasSet)
1462
1463- >>> file_content = "Hello, world"
1464+ >>> file_content = b"Hello, world"
1465 >>> content_type = "text/plain"
1466 >>> file_alias = getUtility(ILibraryFileAliasSet).create(
1467 ... name='foobar', size=len(file_content),
1468- ... file=StringIO(file_content), contentType=content_type)
1469+ ... file=BytesIO(file_content), contentType=content_type)
1470 >>> transaction.commit()
1471
1472 >>> bug = factory.makeBug()
1473@@ -554,13 +554,13 @@
1474 >>> bug.attachments.count()
1475 1
1476 >>> attachment = bug.attachments[0]
1477- >>> print attachment.title
1478+ >>> print(attachment.title)
1479 foobar
1480
1481 The attachment will have a type of BugAttachmentType.UNSPECIFIED, since
1482 we didn't specify that it was a patch.
1483
1484- >>> print attachment.type.title
1485+ >>> print(attachment.type.title)
1486 Unspecified
1487
1488 We can specify that the attachment is a patch and give it a more
1489@@ -568,7 +568,7 @@
1490
1491 >>> file_alias = getUtility(ILibraryFileAliasSet).create(
1492 ... name='anotherfoobar', size=len(file_content),
1493- ... file=StringIO(file_content), contentType=content_type)
1494+ ... file=BytesIO(file_content), contentType=content_type)
1495 >>> transaction.commit()
1496
1497 >>> bug.linkAttachment(
1498@@ -580,10 +580,10 @@
1499 >>> bug.attachments.count()
1500 2
1501 >>> attachment = bug.attachments[1]
1502- >>> print attachment.title
1503+ >>> print(attachment.title)
1504 An attachment of some sort
1505
1506- >>> print attachment.type.title
1507+ >>> print(attachment.type.title)
1508 Patch
1509
1510
1511@@ -620,7 +620,7 @@
1512 ... information_type=InformationType.USERDATA,
1513 ... owner=private_bug_owner)
1514 >>> private_attachment = private_bug.addAttachment(
1515- ... owner=private_bug_owner, data="secret", filename="baz.txt",
1516+ ... owner=private_bug_owner, data=b"secret", filename="baz.txt",
1517 ... comment="Some attachment")
1518 >>> private_attachment.libraryfile.restricted
1519 True
1520@@ -662,4 +662,4 @@
1521 >>> attachment.getFileByName('nonsense')
1522 Traceback (most recent call last):
1523 ...
1524- NotFoundError: 'nonsense'
1525+ NotFoundError: u'nonsense'
1526
1527=== modified file 'lib/lp/bugs/doc/bugcomment.txt'
1528--- lib/lp/bugs/doc/bugcomment.txt 2014-05-29 16:18:50 +0000
1529+++ lib/lp/bugs/doc/bugcomment.txt 2018-06-30 11:02:51 +0000
1530@@ -85,7 +85,7 @@
1531
1532 >>> rendered_comments[0].text_for_display
1533 ''
1534- >>> print rendered_comments[0].text_contents
1535+ >>> print(rendered_comments[0].text_contents)
1536 I've had problems when switching from Jokosher...
1537
1538
1539@@ -123,7 +123,7 @@
1540 display the truncated text using text_for_display:
1541
1542 >>> comment_one = bug_comments(bug_view)[0]
1543- >>> print comment_one.text_for_display #doctest: -ELLIPSIS
1544+ >>> print(comment_one.text_for_display) #doctest: -ELLIPSIS
1545 This would be a real...
1546
1547 The UI will display information about the comment being truncated and
1548@@ -166,7 +166,7 @@
1549 >>> bug_11 = getUtility(IBugSet).get(11)
1550 >>> all_comments = get_comments_for_bugtask(bug_11.bugtasks[0])
1551 >>> for comment in all_comments:
1552- ... print comment.display_title, comment.title
1553+ ... print(comment.display_title, comment.title)
1554 False Make Jokosher use autoaudiosink
1555 False Re: Make Jokosher use autoaudiosink
1556 False Re: Make Jokosher use autoaudiosink
1557@@ -177,7 +177,7 @@
1558 >>> bug_12 = getUtility(IBugSet).get(12)
1559 >>> all_comments = get_comments_for_bugtask(bug_12.bugtasks[0])
1560 >>> for comment in all_comments:
1561- ... print comment.display_title, comment.title
1562+ ... print(comment.display_title, comment.title)
1563 False Copy, Cut and Delete operations should work on selections
1564 False Re: Copy, Cut and Delete operations should work on selections
1565 False Re: Copy, Cut and Delete operations should work on selections
1566@@ -353,8 +353,8 @@
1567 ... activity=[activity_item])
1568
1569 >>> for activity in bug_comment.activity:
1570- ... print "%s: %s" % (
1571- ... activity.change_summary, activity.change_details)
1572+ ... print("%s: %s" % (
1573+ ... activity.change_summary, activity.change_details))
1574 status: New &#8594; Confirmed
1575
1576 The activity will be inserted into the footer of the comment. If a
1577@@ -411,10 +411,10 @@
1578
1579 >>> bug_comment = bug_view.comments[0]
1580 >>> for attachment in bug_comment.bugattachments:
1581- ... print attachment.title, attachment.type.title
1582+ ... print(attachment.title, attachment.type.title)
1583 sample data 1 Unspecified
1584 sample data 2 Unspecified
1585 >>> for patch in bug_comment.patches:
1586- ... print patch.title, patch.type.title
1587+ ... print(patch.title, patch.type.title)
1588 patch 1 Patch
1589 patch 2 Patch
1590
1591=== modified file 'lib/lp/bugs/doc/bugnotification-email.txt'
1592--- lib/lp/bugs/doc/bugnotification-email.txt 2015-10-06 06:48:01 +0000
1593+++ lib/lp/bugs/doc/bugnotification-email.txt 2018-06-30 11:02:51 +0000
1594@@ -58,7 +58,7 @@
1595 >>> subject
1596 u'[Bug 4] [NEW] Reflow problems with complex page layouts'
1597
1598- >>> print body
1599+ >>> print(body)
1600 Public bug reported:
1601 <BLANKLINE>
1602 Malone pages that use more complex layouts with portlets and fancy CSS
1603@@ -80,7 +80,7 @@
1604 >>> subject
1605 u'[Bug 4] [NEW] Reflow problems with complex page layouts'
1606
1607- >>> print body
1608+ >>> print(body)
1609 Public bug reported:
1610 <BLANKLINE>
1611 Malone pages that use more complex layouts with portlets and fancy CSS
1612@@ -101,7 +101,7 @@
1613 >>> subject
1614 u'[Bug 4] [NEW] Reflow problems with complex page layouts'
1615
1616- >>> print body
1617+ >>> print(body)
1618 *** This bug is a security vulnerability ***
1619 <BLANKLINE>
1620 Public security bug reported:
1621@@ -115,7 +115,7 @@
1622 True
1623
1624 >>> subject, body = generate_bug_add_email(bug_four)
1625- >>> print body
1626+ >>> print(body)
1627 *** This bug is a security vulnerability ***
1628 <BLANKLINE>
1629 Private security bug reported:
1630@@ -161,8 +161,8 @@
1631
1632 >>> for change in get_bug_changes(bug_delta):
1633 ... notification = change.getBugNotification()
1634- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1635- ... print "-----------------------------"
1636+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1637+ ... print("-----------------------------")
1638 ** Summary changed:
1639 <BLANKLINE>
1640 - Blackhole Trash folder
1641@@ -201,8 +201,8 @@
1642 ... })
1643 >>> for change in get_bug_changes(bug_delta):
1644 ... notification = change.getBugNotification()
1645- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1646- ... print "-----------------------------"
1647+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1648+ ... print("-----------------------------")
1649 ** Description changed:
1650 <BLANKLINE>
1651 - The Trash folder seems to have significant problems! At the moment,
1652@@ -241,8 +241,8 @@
1653 >>> for change in get_bug_changes(bug_delta):
1654 ... notification = change.getBugNotification()
1655 ... text_representation = notification['text']
1656- ... print text_representation #doctest: -NORMALIZE_WHITESPACE
1657- ... print "-----------------------------"
1658+ ... print(text_representation) #doctest: -NORMALIZE_WHITESPACE
1659+ ... print("-----------------------------")
1660 ** Information type changed from Public to Private Security
1661 -----------------------------
1662
1663@@ -261,8 +261,8 @@
1664 ... })
1665 >>> for change in get_bug_changes(bug_delta):
1666 ... notification = change.getBugNotification()
1667- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1668- ... print "-----------------------------"
1669+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1670+ ... print("-----------------------------")
1671 ** Information type changed from Private Security to Public
1672 -----------------------------
1673
1674@@ -277,8 +277,8 @@
1675 ... tags={'old': old_tags, 'new': edited_bug.tags})
1676 >>> for change in get_bug_changes(bug_delta):
1677 ... notification = change.getBugNotification()
1678- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1679- ... print "-----------------------------"
1680+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1681+ ... print("-----------------------------")
1682 ** Tags added: bar foo
1683 -----------------------------
1684
1685@@ -293,8 +293,8 @@
1686 ... tags={'old': old_tags, 'new': edited_bug.tags})
1687 >>> for change in get_bug_changes(bug_delta):
1688 ... notification = change.getBugNotification()
1689- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1690- ... print "-----------------------------"
1691+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1692+ ... print("-----------------------------")
1693 ** Tags removed: bar
1694 ** Tags added: baz
1695 -----------------------------
1696@@ -335,8 +335,8 @@
1697 ... bugtask_deltas=bugtask_delta)
1698 >>> for change in get_bug_changes(bug_delta):
1699 ... notification = change.getBugNotification()
1700- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1701- ... print "-----------------------------"
1702+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1703+ ... print("-----------------------------")
1704 ** Changed in: firefox
1705 Status: New => Confirmed
1706 -----------------------------
1707@@ -348,7 +348,7 @@
1708 edited:
1709
1710 >>> debian_bugtask = getUtility(IBugTaskSet).get(5)
1711- >>> print debian_bugtask.bugtargetname
1712+ >>> print(debian_bugtask.bugtargetname)
1713 mozilla-firefox (Debian)
1714
1715 >>> debian_bugtask.transitionToAssignee(None)
1716@@ -362,8 +362,8 @@
1717 ... bugtask_deltas=bugtask_delta)
1718 >>> for change in get_bug_changes(bug_delta):
1719 ... notification = change.getBugNotification()
1720- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1721- ... print "-----------------------------"
1722+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1723+ ... print("-----------------------------")
1724 ** Changed in: mozilla-firefox (Debian)
1725 Assignee: Sample Person (name12) => (unassigned)
1726 -----------------------------
1727@@ -384,8 +384,8 @@
1728 ... attachment={'new' : attachment, 'old': None})
1729 >>> for change in get_bug_changes(bug_delta):
1730 ... notification = change.getBugNotification()
1731- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1732- ... print "-----------------------------"
1733+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1734+ ... print("-----------------------------")
1735 ** Attachment added: "A screenshot of the problem"
1736 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/screenshot.png
1737 -----------------------------
1738@@ -399,8 +399,8 @@
1739 ... attachment={'old' : attachment, 'new': None})
1740 >>> for change in get_bug_changes(bug_delta):
1741 ... notification = change.getBugNotification()
1742- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1743- ... print "-----------------------------"
1744+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1745+ ... print("-----------------------------")
1746 ** Attachment removed: "A screenshot of the problem"
1747 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/screenshot.png
1748 -----------------------------
1749@@ -418,8 +418,8 @@
1750 ... attachment={'new' : attachment, 'old': None})
1751 >>> for change in get_bug_changes(bug_delta):
1752 ... notification = change.getBugNotification()
1753- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1754- ... print "-----------------------------"
1755+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1756+ ... print("-----------------------------")
1757 ** Patch added: "A new icon for the application"
1758 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/new-icon.png
1759 -----------------------------
1760@@ -433,8 +433,8 @@
1761 ... attachment={'old' : attachment, 'new': None})
1762 >>> for change in get_bug_changes(bug_delta):
1763 ... notification = change.getBugNotification()
1764- ... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
1765- ... print "-----------------------------"
1766+ ... print(notification['text']) #doctest: -NORMALIZE_WHITESPACE
1767+ ... print("-----------------------------")
1768 ** Patch removed: "A new icon for the application"
1769 http://bugs.launchpad.dev/bugs/.../+attachment/.../+files/new-icon.png
1770 -----------------------------
1771@@ -520,7 +520,7 @@
1772 >>> bug_four_notification_builder = BugNotificationBuilder(bug_four,
1773 ... private_person)
1774 >>> for header in bug_four_notification_builder.common_headers:
1775- ... print ': '.join(header)
1776+ ... print(': '.join(header))
1777 Reply-To: Bug 4 <4@bugs.launchpad.net>
1778 Sender: bounces@canonical.com
1779 X-Launchpad-Notification-Type: bug
1780@@ -554,19 +554,19 @@
1781 the parameters that were used to instantiate BugNotificationBuilder and
1782 passed to <builder>.build().
1783
1784- >>> print notification_email['From']
1785+ >>> print(notification_email['From'])
1786 Launchpad Bug Tracker <4@bugs.launchpad.net>
1787
1788- >>> print notification_email['To']
1789+ >>> print(notification_email['To'])
1790 foo.bar@canonical.com
1791
1792- >>> print notification_email['Subject']
1793+ >>> print(notification_email['Subject'])
1794 [Bug 4] A test subject.
1795
1796- >>> print notification_email['Date']
1797+ >>> print(notification_email['Date'])
1798 Tue, 20 May 2008 09:05:47 -0000
1799
1800- >>> print notification_email.get_payload()
1801+ >>> print(notification_email.get_payload())
1802 A test body.
1803
1804 The <builder>.build() method also accepts parameters for rationale,
1805@@ -582,24 +582,24 @@
1806 The X-Launchpad-Message-Rationale header is set from the rationale
1807 parameter.
1808
1809- >>> print notification_email['X-Launchpad-Message-Rationale']
1810+ >>> print(notification_email['X-Launchpad-Message-Rationale'])
1811 Because-I-said-so
1812
1813 The X-Launchpad-Message-For header is set from the to_person (since this
1814 notification is not for a team).
1815
1816- >>> print notification_email['X-Launchpad-Message-For']
1817+ >>> print(notification_email['X-Launchpad-Message-For'])
1818 name16
1819
1820 The references parameter sets the References header of the email.
1821
1822- >>> print notification_email['References']
1823+ >>> print(notification_email['References'])
1824 <12345@launchpad.net>
1825
1826 And the message_id parameter is used to set the Message-Id header. It
1827 will be auto-generated if it is not supplied.
1828
1829- >>> print notification_email['Message-Id']
1830+ >>> print(notification_email['Message-Id'])
1831 <67890@launchpad.net>
1832
1833 The message subject will always have [Bug <bug_id>] prepended to it.
1834@@ -608,7 +608,7 @@
1835 ... from_address, to_person,
1836 ... "A test body.", "Yet another message", sending_date)
1837
1838- >>> print notification_email['Subject']
1839+ >>> print(notification_email['Subject'])
1840 [Bug 4] Yet another message
1841
1842 If the subject passed is None the email subject will be set to [Bug
1843@@ -617,5 +617,5 @@
1844 >>> notification_email = bug_four_notification_builder.build(
1845 ... from_address, to_person, "A test body.", None, sending_date)
1846
1847- >>> print notification_email['Subject']
1848+ >>> print(notification_email['Subject'])
1849 [Bug 4]
1850
1851=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
1852--- lib/lp/bugs/doc/bugnotification-sending.txt 2016-01-26 15:47:37 +0000
1853+++ lib/lp/bugs/doc/bugnotification-sending.txt 2018-06-30 11:02:51 +0000
1854@@ -25,14 +25,14 @@
1855 ... 'X-Launchpad-Message-For',
1856 ... 'X-Launchpad-Subscription'] + extra_headers:
1857 ... if email_notification[header]:
1858- ... print "%s: %s" % (header, email_notification[header])
1859+ ... print("%s: %s" % (header, email_notification[header]))
1860
1861 >>> def print_notification(email_notification, extra_headers=[]):
1862 ... print_notification_headers(
1863 ... email_notification, extra_headers=extra_headers)
1864- ... print
1865- ... print email_notification.get_payload(decode=True)
1866- ... print "-" * 70
1867+ ... print()
1868+ ... print(email_notification.get_payload(decode=True))
1869+ ... print("-" * 70)
1870
1871 We'll also import a helper function to help us with database users.
1872
1873@@ -105,7 +105,7 @@
1874 message id as its reference, in order to make it thread properly in the
1875 email client.
1876
1877- >>> print bug_one.initial_message.rfc822msgid
1878+ >>> print(bug_one.initial_message.rfc822msgid)
1879 sdsdfsfd
1880
1881 The notification is still pending to be sent, since date_emailed is
1882@@ -314,7 +314,7 @@
1883 >>> addressless.preferredemail is None
1884 True
1885 >>> for member in addressless.activemembers:
1886- ... print member.preferredemail.email
1887+ ... print(member.preferredemail.email)
1888 owner@example.com
1889
1890 >>> with lp_dbuser():
1891@@ -332,7 +332,7 @@
1892 >>> email_notifications = get_email_notifications(pending_notifications)
1893 >>> for bug_notifications, omitted, messages in email_notifications:
1894 ... for message in messages:
1895- ... print message['To']
1896+ ... print(message['To'])
1897 foo.bar@canonical.com
1898 mark@example.com
1899 owner@example.com
1900@@ -538,7 +538,7 @@
1901 >>> (out, err) = process.communicate()
1902 >>> process.returncode
1903 0
1904- >>> print err
1905+ >>> print(err)
1906 DEBUG ...
1907 INFO Notifying test@canonical.com about bug 2.
1908 ...
1909@@ -624,7 +624,7 @@
1910 ... identifier = 'comment'
1911 ... else:
1912 ... identifier = notification.activity.whatchanged
1913- ... print identifier, notification.status.title
1914+ ... print(identifier, notification.status.title)
1915 comment Sent
1916 summary Sent
1917 comment Sent
1918@@ -744,15 +744,15 @@
1919 and X-Launchpad-Bug-Security-Vulnerability headers are also set. These headers
1920 can have the value "yes" or "no".
1921
1922- >>> print bug_three.information_type.title
1923+ >>> print(bug_three.information_type.title)
1924 Public
1925
1926 >>> def print_message_header_details(message):
1927- ... print '%s %s %s %s' % (
1928+ ... print('%s %s %s %s' % (
1929 ... message['To'],
1930 ... message.get_all('X-Launchpad-Bug-Private'),
1931 ... message.get_all('X-Launchpad-Bug-Security-Vulnerability'),
1932- ... message.get_all('X-Launchpad-Bug-Information-Type'))
1933+ ... message.get_all('X-Launchpad-Bug-Information-Type')))
1934
1935 >>> for message in trigger_and_get_email_messages(bug_three):
1936 ... print_message_header_details(message)
1937@@ -764,7 +764,7 @@
1938 ... bug_three.transitionToInformationType(
1939 ... InformationType.USERDATA, sample_person)
1940 True
1941- >>> print bug_three.information_type.title
1942+ >>> print(bug_three.information_type.title)
1943 Private
1944
1945 >>> for message in trigger_and_get_email_messages(bug_three):
1946@@ -777,7 +777,7 @@
1947 ... bug_three.transitionToInformationType(
1948 ... InformationType.PRIVATESECURITY, getUtility(ILaunchBag).user)
1949 True
1950- >>> print bug_three.information_type.title
1951+ >>> print(bug_three.information_type.title)
1952 Private Security
1953
1954 >>> for message in trigger_and_get_email_messages(bug_three):
1955@@ -793,7 +793,7 @@
1956 list.
1957
1958 >>> message = trigger_and_get_email_messages(bug_three)[0]
1959- >>> print message.get('X-Launchpad-Bug-Commenters')
1960+ >>> print(message.get('X-Launchpad-Bug-Commenters'))
1961 name12
1962
1963 >>> from lp.registry.interfaces.person import IPersonSet
1964@@ -805,7 +805,7 @@
1965 ... 'Hungry', bug_three, foo_bar, "Make me a sandwich.")
1966
1967 >>> message = trigger_and_get_email_messages(bug_three)[0]
1968- >>> print message.get('X-Launchpad-Bug-Commenters')
1969+ >>> print(message.get('X-Launchpad-Bug-Commenters'))
1970 name12 name16
1971
1972 It only lists each user once, no matter how many comments they've
1973@@ -816,7 +816,7 @@
1974 ... 'Hungry', bug_three, foo_bar, "Make me a sandwich.")
1975
1976 >>> message = trigger_and_get_email_messages(bug_three)[0]
1977- >>> print message.get('X-Launchpad-Bug-Commenters')
1978+ >>> print(message.get('X-Launchpad-Bug-Commenters'))
1979 name12 name16
1980
1981
1982@@ -827,7 +827,7 @@
1983 user who originally reported the bug and opened the bug's first bug task.
1984
1985 >>> message = trigger_and_get_email_messages(bug_three)[0]
1986- >>> print message.get('X-Launchpad-Bug-Reporter')
1987+ >>> print(message.get('X-Launchpad-Bug-Reporter'))
1988 Foo Bar (name16)
1989
1990
1991@@ -1058,25 +1058,25 @@
1992
1993 >>> message = collated_messages['conciseteam@example.com'][0]
1994 >>> payload = message.get_payload(decode=True)
1995- >>> print payload.split('\n')
1996+ >>> print(payload.split('\n'))
1997 [...
1998- 'Title:',
1999- ' In the beginning, the universe was created. This has made a lot of',
2000- ' people very angry and has been widely regarded as a bad move',
2001+ u'Title:',
2002+ u' In the beginning, the universe was created. This has made a lot of',
2003+ u' people very angry and has been widely regarded as a bad move',
2004 ...
2005- 'Bug description:',
2006- ' This is a long description of the bug, which will be automatically',
2007- " wrapped by the BugNotification machinery. Ain't technology great?"...]
2008+ u'Bug description:',
2009+ u' This is a long description of the bug, which will be automatically',
2010+ u" wrapped by the BugNotification machinery. Ain't technology great?"...]
2011
2012 The title is also wrapped and indented in normal notifications.
2013
2014 >>> message = collated_messages['verboseteam@example.com'][0]
2015 >>> payload = message.get_payload(decode=True)
2016- >>> print payload.strip().split('\n')
2017+ >>> print(payload.strip().split('\n'))
2018 [...
2019- 'Title:',
2020- ' In the beginning, the universe was created. This has made a lot of',
2021- ' people very angry and has been widely regarded as a bad move'...]
2022+ u'Title:',
2023+ u' In the beginning, the universe was created. This has made a lot of',
2024+ u' people very angry and has been widely regarded as a bad move'...]
2025
2026 Self-Generated Bug Notifications
2027 --------------------------------
2028@@ -1127,7 +1127,7 @@
2029 have any filters other than the initial catch-all one, so they receive these
2030 notifications.
2031
2032- >>> print subscription_no_priv.bug_filters.count()
2033+ >>> print(subscription_no_priv.bug_filters.count())
2034 1
2035 >>> comment = getUtility(IMessageSet).fromText(
2036 ... 'subject', 'another comment.', sample_person,
2037
2038=== modified file 'lib/lp/bugs/doc/bugnotifications.txt'
2039--- lib/lp/bugs/doc/bugnotifications.txt 2017-05-31 17:31:58 +0000
2040+++ lib/lp/bugs/doc/bugnotifications.txt 2018-06-30 11:02:51 +0000
2041@@ -43,12 +43,12 @@
2042
2043 >>> from lp.bugs.model.bugnotification import BugNotification
2044 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2045- >>> print latest_notification.message.owner.displayname
2046+ >>> print(latest_notification.message.owner.displayname)
2047 Sample Person
2048
2049 >>> latest_notification.is_comment
2050 True
2051- >>> print latest_notification.message.text_contents
2052+ >>> print(latest_notification.message.text_contents)
2053 this is a comment
2054
2055 Notifications usually have references to a corresponding bug activity. These
2056@@ -56,9 +56,9 @@
2057 perspective. You can get details on what the activity provides in
2058 bugactivity.txt, but for now here is a small demo.
2059
2060- >>> print latest_notification.activity.whatchanged
2061+ >>> print(latest_notification.activity.whatchanged)
2062 bug
2063- >>> print latest_notification.activity.person.displayname
2064+ >>> print(latest_notification.activity.person.displayname)
2065 Sample Person
2066
2067
2068@@ -74,19 +74,19 @@
2069 >>> notify(firefox_crashes_modified)
2070
2071 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2072- >>> print latest_notification.message.owner.displayname
2073+ >>> print(latest_notification.message.owner.displayname)
2074 Sample Person
2075
2076 >>> latest_notification.is_comment
2077 False
2078- >>> print latest_notification.message.text_contents
2079+ >>> print(latest_notification.message.text_contents)
2080 ** Description changed:
2081 ...
2082- >>> print latest_notification.activity.attribute
2083+ >>> print(latest_notification.activity.attribute)
2084 description
2085- >>> print latest_notification.activity.oldvalue
2086+ >>> print(latest_notification.activity.oldvalue)
2087 this is a comment
2088- >>> print latest_notification.activity.newvalue
2089+ >>> print(latest_notification.activity.newvalue)
2090 a new description
2091
2092
2093@@ -113,12 +113,12 @@
2094 ... firefox_crashes_in_debian, firefox_crashes_in_debian.owner))
2095
2096 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2097- >>> print latest_notification.message.owner.displayname
2098+ >>> print(latest_notification.message.owner.displayname)
2099 Sample Person
2100
2101 >>> latest_notification.is_comment
2102 False
2103- >>> print latest_notification.message.text_contents
2104+ >>> print(latest_notification.message.text_contents)
2105 ** Also affects: mozilla-firefox (Debian)
2106 ...
2107
2108@@ -139,12 +139,12 @@
2109 ... firefox_crashes_in_sid, firefox_crashes_in_sid.owner))
2110
2111 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2112- >>> print latest_notification.message.owner.displayname
2113+ >>> print(latest_notification.message.owner.displayname)
2114 Sample Person
2115
2116 >>> latest_notification.is_comment
2117 False
2118- >>> print latest_notification.message.text_contents
2119+ >>> print(latest_notification.message.text_contents)
2120 ** Also affects: mozilla-firefox (Debian Sid)
2121 ...
2122
2123@@ -167,12 +167,12 @@
2124 ... evolution_crashes_too, evolution_crashes_too.owner))
2125
2126 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2127- >>> print latest_notification.message.owner.displayname
2128+ >>> print(latest_notification.message.owner.displayname)
2129 Sample Person
2130
2131 >>> latest_notification.is_comment
2132 False
2133- >>> print latest_notification.message.text_contents
2134+ >>> print(latest_notification.message.text_contents)
2135 ** Also affects: evolution
2136 ...
2137
2138@@ -189,12 +189,12 @@
2139 ... firefox_crashes_in_trunk, firefox_crashes_in_trunk.owner))
2140
2141 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2142- >>> print latest_notification.message.owner.displayname
2143+ >>> print(latest_notification.message.owner.displayname)
2144 Sample Person
2145
2146 >>> latest_notification.is_comment
2147 False
2148- >>> print latest_notification.message.text_contents
2149+ >>> print(latest_notification.message.text_contents)
2150 ** Also affects: evolution/trunk
2151 ...
2152
2153@@ -211,12 +211,12 @@
2154 >>> notify(ObjectCreatedEvent(comment_on_firefox_crashes_in_debian))
2155
2156 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2157- >>> print latest_notification.message.owner.displayname
2158+ >>> print(latest_notification.message.owner.displayname)
2159 Sample Person
2160
2161 >>> latest_notification.is_comment
2162 True
2163- >>> print latest_notification.message.text_contents
2164+ >>> print(latest_notification.message.text_contents)
2165 just a test comment
2166
2167
2168@@ -242,12 +242,12 @@
2169 >>> notify(debian_task_modified)
2170
2171 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2172- >>> print latest_notification.message.owner.displayname
2173+ >>> print(latest_notification.message.owner.displayname)
2174 Sample Person
2175
2176 >>> latest_notification.is_comment
2177 False
2178- >>> print latest_notification.message.text_contents
2179+ >>> print(latest_notification.message.text_contents)
2180 ** Changed in: mozilla-firefox (Debian)
2181 ...
2182
2183@@ -262,12 +262,12 @@
2184 >>> notify(firefox_task_modified)
2185
2186 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2187- >>> print latest_notification.message.owner.displayname
2188+ >>> print(latest_notification.message.owner.displayname)
2189 Sample Person
2190
2191 >>> latest_notification.is_comment
2192 False
2193- >>> print latest_notification.message.text_contents
2194+ >>> print(latest_notification.message.text_contents)
2195 ** Changed in: evolution/trunk
2196 ...
2197
2198@@ -287,12 +287,12 @@
2199 >>> bugcve = cve.linkBug(bug) # note this creates the event and notifies
2200
2201 >>> latest_notification = BugNotification.selectFirst(orderBy='-id')
2202- >>> print latest_notification.message.owner.displayname
2203+ >>> print(latest_notification.message.owner.displayname)
2204 Sample Person
2205
2206 >>> latest_notification.is_comment
2207 False
2208- >>> print latest_notification.message.text_contents
2209+ >>> print(latest_notification.message.text_contents)
2210 ** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2004-0276
2211
2212
2213
2214=== modified file 'lib/lp/bugs/doc/bugsubscription.txt'
2215--- lib/lp/bugs/doc/bugsubscription.txt 2016-01-26 15:47:37 +0000
2216+++ lib/lp/bugs/doc/bugsubscription.txt 2018-06-30 11:02:51 +0000
2217@@ -57,11 +57,11 @@
2218 >>> linux_source = ubuntu.getSourcePackage("linux-source-2.6.15")
2219 >>> list(linux_source.bug_subscriptions)
2220 []
2221- >>> print linux_source.distribution.bug_supervisor
2222+ >>> print(linux_source.distribution.bug_supervisor)
2223 None
2224
2225 >>> foobar = getUtility(ILaunchBag).user
2226- >>> print foobar.name
2227+ >>> print(foobar.name)
2228 name16
2229
2230 >>> params = CreateBugParams(
2231@@ -76,7 +76,7 @@
2232 ... subscriber_names = sorted(subscriber.displayname
2233 ... for subscriber in subscribers)
2234 ... for name in subscriber_names:
2235- ... print name
2236+ ... print(name)
2237
2238 >>> print_displayname(linux_source_bug.getDirectSubscribers())
2239 Foo Bar
2240@@ -243,7 +243,7 @@
2241 In the case of bug notification levels, that is equivalent to
2242 BugNotificationLevel.COMMENTS.
2243
2244- >>> print subscription_no_priv.bug_filters.count()
2245+ >>> print(subscription_no_priv.bug_filters.count())
2246 1
2247
2248 With this subscription level, No Privileges Person is returned for all
2249@@ -459,7 +459,7 @@
2250 By default, the bug_notification_level of the new subscription will be
2251 COMMENTS, so the user will receive all notifications about the bug.
2252
2253- >>> print subscription.bug_notification_level.name
2254+ >>> print(subscription.bug_notification_level.name)
2255 COMMENTS
2256
2257 It's possible to subscribe to a bug at a different BugNotificationLevel
2258@@ -471,7 +471,7 @@
2259 ... metadata_subscriber, metadata_subscriber,
2260 ... level=BugNotificationLevel.METADATA)
2261
2262- >>> print metadata_subscription.bug_notification_level.name
2263+ >>> print(metadata_subscription.bug_notification_level.name)
2264 METADATA
2265
2266 To unsubscribe from all dupes for a bug, call
2267@@ -640,7 +640,7 @@
2268 >>> ubuntu_task = getUtility(IBugTaskSet).createTask(
2269 ... new_bug, mark, ubuntu)
2270
2271- >>> print '\n'.join(getSubscribers(new_bug))
2272+ >>> print('\n'.join(getSubscribers(new_bug)))
2273 foo.bar@canonical.com
2274
2275 But still, only Foo Bar is explicitly subscribed.
2276@@ -669,14 +669,14 @@
2277 But the product owner, Sample Person, is implicitly added to the
2278 recipient list:
2279
2280- >>> print '\n'.join(getSubscribers(new_bug))
2281+ >>> print('\n'.join(getSubscribers(new_bug)))
2282 foo.bar@canonical.com
2283 >>> params = CreateBugParams(
2284 ... title="a test bug", comment="a test description",
2285 ... owner=foobar, information_type=InformationType.PRIVATESECURITY)
2286 >>> new_bug = firefox.createBug(params)
2287
2288- >>> print '\n'.join(getSubscribers(new_bug))
2289+ >>> print('\n'.join(getSubscribers(new_bug)))
2290 foo.bar@canonical.com
2291
2292 Now let's create a bug on a specific package, which has no package bug
2293@@ -761,7 +761,7 @@
2294 ... subscription.display_subscribed_by)
2295 ... for subscription in ff_bug.getDirectSubscriptions()]
2296 >>> for subscription in sorted(subscriptions):
2297- ... print subscription
2298+ ... print(subscription)
2299 Mark Shuttleworth: Self-subscribed
2300 Robert Collins: Subscribed by Mark Shuttleworth (mark)
2301 >>> params = CreateBugParams(
2302@@ -773,8 +773,8 @@
2303 >>> dupe_ff_bug.subscribe(foobar, lifeless)
2304 <lp.bugs.model.bugsubscription.BugSubscription ...>
2305 >>> for subscription in ff_bug.getSubscriptionsFromDuplicates():
2306- ... print '%s: %s' % (
2307+ ... print('%s: %s' % (
2308 ... subscription.person.displayname,
2309- ... subscription.display_duplicate_subscribed_by)
2310+ ... subscription.display_duplicate_subscribed_by))
2311 Scott James Remnant: Self-subscribed to bug ...
2312 Foo Bar: Subscribed to bug ... by Robert Collins (lifeless)
2313
2314=== modified file 'lib/lp/bugs/doc/bugsummary.txt'
2315--- lib/lp/bugs/doc/bugsummary.txt 2013-06-20 05:50:00 +0000
2316+++ lib/lp/bugs/doc/bugsummary.txt 2018-06-30 11:02:51 +0000
2317@@ -84,9 +84,9 @@
2318 ... fmt += ' %3s'
2319 ... titles += ('#',)
2320 ... header = fmt % titles
2321- ... print "-" * len(header)
2322- ... print header
2323- ... print "-" * len(header)
2324+ ... print("-" * len(header))
2325+ ... print(header)
2326+ ... print("-" * len(header))
2327 ... for bugsummary in ordered_results:
2328 ... if not include_privacy:
2329 ... assert bugsummary.viewed_by is None
2330@@ -107,12 +107,12 @@
2331 ... name(bugsummary.viewed_by),
2332 ... ap_desc(bugsummary.access_policy),
2333 ... )
2334- ... print fmt % (data + (bugsummary.count,))
2335- ... print " " * (len(header) - 4),
2336- ... print "==="
2337+ ... print(fmt % (data + (bugsummary.count,)))
2338+ ... print(" " * (len(header) - 4), end=" ")
2339+ ... print("===")
2340 ... sum = bugsummary_resultset.sum(BugSummary.count)
2341- ... print " " * (len(header) - 4),
2342- ... print "%3s" % sum
2343+ ... print(" " * (len(header) - 4), end=" ")
2344+ ... print("%3s" % sum)
2345
2346 >>> def print_find(*bs_query_args, **bs_query_kw):
2347 ... include_privacy = bs_query_kw.pop('include_privacy', False)
2348@@ -269,9 +269,9 @@
2349 ... ).group_by(Milestone).order_by(Milestone.name)
2350 >>> for milestone, count in results:
2351 ... if milestone:
2352- ... print milestone.name, count
2353+ ... print(milestone.name, count)
2354 ... else:
2355- ... print None, count
2356+ ... print(None, count)
2357 ms-a 1
2358 None 4
2359
2360
2361=== modified file 'lib/lp/bugs/doc/bugtarget.txt'
2362--- lib/lp/bugs/doc/bugtarget.txt 2015-07-21 09:04:01 +0000
2363+++ lib/lp/bugs/doc/bugtarget.txt 2018-06-30 11:02:51 +0000
2364@@ -36,25 +36,25 @@
2365 >>> IBugTarget.providedBy(debian_woody_firefox)
2366 True
2367
2368- >>> print firefox.bugtargetdisplayname
2369+ >>> print(firefox.bugtargetdisplayname)
2370 Mozilla Firefox
2371- >>> print firefox.bugtargetname
2372+ >>> print(firefox.bugtargetname)
2373 firefox
2374- >>> print firefox_1_0.bugtargetdisplayname
2375+ >>> print(firefox_1_0.bugtargetdisplayname)
2376 Mozilla Firefox 1.0
2377- >>> print firefox_1_0.bugtargetname
2378+ >>> print(firefox_1_0.bugtargetname)
2379 firefox/1.0
2380- >>> print debian.bugtargetdisplayname
2381+ >>> print(debian.bugtargetdisplayname)
2382 Debian
2383- >>> print debian.bugtargetname
2384+ >>> print(debian.bugtargetname)
2385 debian
2386- >>> print debian_firefox.bugtargetdisplayname
2387- mozilla-firefox (Debian)
2388- >>> print debian_firefox.bugtargetname
2389- mozilla-firefox (Debian)
2390- >>> print debian_woody.bugtargetdisplayname
2391+ >>> print(debian_firefox.bugtargetdisplayname)
2392+ mozilla-firefox (Debian)
2393+ >>> print(debian_firefox.bugtargetname)
2394+ mozilla-firefox (Debian)
2395+ >>> print(debian_woody.bugtargetdisplayname)
2396 Debian Woody
2397- >>> print debian_woody_firefox.bugtargetdisplayname
2398+ >>> print(debian_woody_firefox.bugtargetdisplayname)
2399 mozilla-firefox (Debian Woody)
2400- >>> print debian_woody_firefox.bugtargetname
2401+ >>> print(debian_woody_firefox.bugtargetname)
2402 mozilla-firefox (Debian Woody)
2403
2404=== modified file 'lib/lp/bugs/doc/bugtask-assignee-widget.txt'
2405--- lib/lp/bugs/doc/bugtask-assignee-widget.txt 2011-12-24 17:49:30 +0000
2406+++ lib/lp/bugs/doc/bugtask-assignee-widget.txt 2018-06-30 11:02:51 +0000
2407@@ -116,15 +116,15 @@
2408 >>> widget.name
2409 'field.assignee'
2410 >>> widget.setPrefix('foo')
2411- >>> widget.name
2412- 'foo.assignee'
2413+ >>> print(widget.name)
2414+ foo.assignee
2415
2416 The chooser widget got its name updated as well.
2417
2418- >>> widget.assignee_chooser_widget.name
2419- 'foo.assignee'
2420- >>> widget.assignee_chooser_widget.onKeyPress
2421- "selectWidget('foo.assignee.assign_to', event)"
2422+ >>> print(widget.assignee_chooser_widget.name)
2423+ foo.assignee
2424+ >>> print(widget.assignee_chooser_widget.onKeyPress)
2425+ selectWidget('foo.assignee.assign_to', event)
2426
2427 If this option is selected, but no value is entered in
2428 "field.assignee", validation will fail:
2429
2430=== modified file 'lib/lp/bugs/doc/bugtask-bugwatch-widget.txt'
2431--- lib/lp/bugs/doc/bugtask-bugwatch-widget.txt 2017-10-21 18:14:14 +0000
2432+++ lib/lp/bugs/doc/bugtask-bugwatch-widget.txt 2018-06-30 11:02:51 +0000
2433@@ -40,7 +40,7 @@
2434 ... selected = 'SELECTED'
2435 ... else:
2436 ... selected = 'NOT SELECTED'
2437- ... print "%s: %s" % (selected, label_td.label)
2438+ ... print("%s: %s" % (selected, label_td.label))
2439
2440 Now if we pass None to renderItems(), the first radio button will be
2441 selected.
2442@@ -94,8 +94,8 @@
2443 the bug.
2444
2445 >>> for bug_watch in bug_one.watches:
2446- ... print "%s: #%s" % (
2447- ... bug_watch.bugtracker.title, bug_watch.remotebug)
2448+ ... print("%s: #%s" % (
2449+ ... bug_watch.bugtracker.title, bug_watch.remotebug))
2450 The Mozilla.org Bug Tracker: #123543
2451 The Mozilla.org Bug Tracker: #2000
2452 The Mozilla.org Bug Tracker: #42
2453@@ -117,8 +117,8 @@
2454 u'84'
2455
2456 >>> for bug_watch in bug_one.watches:
2457- ... print "%s: #%s" % (
2458- ... bug_watch.bugtracker.title, bug_watch.remotebug)
2459+ ... print("%s: #%s" % (
2460+ ... bug_watch.bugtracker.title, bug_watch.remotebug))
2461 The Mozilla.org Bug Tracker: #123543
2462 The Mozilla.org Bug Tracker: #2000
2463 The Mozilla.org Bug Tracker: #42
2464@@ -140,8 +140,8 @@
2465 u'84'
2466
2467 >>> for bug_watch in bug_one.watches:
2468- ... print "%s: #%s" % (
2469- ... bug_watch.bugtracker.title, bug_watch.remotebug)
2470+ ... print("%s: #%s" % (
2471+ ... bug_watch.bugtracker.title, bug_watch.remotebug))
2472 The Mozilla.org Bug Tracker: #123543
2473 The Mozilla.org Bug Tracker: #2000
2474 The Mozilla.org Bug Tracker: #42
2475
2476=== modified file 'lib/lp/bugs/doc/bugtask-display-widgets.txt'
2477--- lib/lp/bugs/doc/bugtask-display-widgets.txt 2016-01-26 15:47:37 +0000
2478+++ lib/lp/bugs/doc/bugtask-display-widgets.txt 2018-06-30 11:02:51 +0000
2479@@ -22,7 +22,7 @@
2480
2481 >>> assignee_field = IBugTask['assignee'].bind(firefox_bugtask)
2482 >>> assignee_widget = AssigneeDisplayWidget(assignee_field, None, None)
2483- >>> print assignee_widget()
2484+ >>> print(assignee_widget())
2485 <a href="http://.../~mark"><img
2486 style="padding-bottom: 2px" alt="" src="/@@/person" />
2487 Mark Shuttleworth</a>
2488@@ -33,7 +33,7 @@
2489 >>> from lp.registry.interfaces.person import IPersonSet
2490 >>> foo_bar = getUtility(IPersonSet).getByEmail('foo.bar@canonical.com')
2491 >>> assignee_widget.setRenderedValue(foo_bar)
2492- >>> print assignee_widget()
2493+ >>> print(assignee_widget())
2494 <a href="http://.../~name16"><img
2495 style="padding-bottom: 2px" alt="" src="/@@/person" />
2496 Foo Bar</a>
2497@@ -43,7 +43,7 @@
2498 >>> firefox_ubuntu_bugtask = bug_one.bugtasks[1]
2499 >>> assignee_field = IBugTask['assignee'].bind(firefox_ubuntu_bugtask)
2500 >>> assignee_widget = AssigneeDisplayWidget(assignee_field, None, None)
2501- >>> print assignee_widget()
2502+ >>> print(assignee_widget())
2503 <i>not assigned</i>
2504
2505 If it's a remote bug task, where the information is pulled from a bug
2506@@ -56,7 +56,7 @@
2507 False
2508 >>> assignee_field = IBugTask['assignee'].bind(thunderbird_bugtask)
2509 >>> assignee_widget = AssigneeDisplayWidget(assignee_field, None, None)
2510- >>> print assignee_widget()
2511+ >>> print(assignee_widget())
2512 <i>unknown</i>
2513
2514 DBItemDisplayWidget
2515@@ -71,7 +71,7 @@
2516 'New'
2517 >>> status_field = IBugTask['status'].bind(firefox_bugtask)
2518 >>> status_widget = DBItemDisplayWidget(status_field, None, None)
2519- >>> print status_widget()
2520+ >>> print(status_widget())
2521 <span class="statusNEW">New</span>
2522
2523 If the value is None, a dash is displayed:
2524@@ -81,12 +81,12 @@
2525 True
2526 >>> assignee_field = IBugTask['assignee'].bind(test_task)
2527 >>> assignee_widget = DBItemDisplayWidget(assignee_field, None, None)
2528- >>> print assignee_widget()
2529+ >>> print(assignee_widget())
2530 <span>&mdash;</span>
2531
2532 We can set a specific value to be displayed using setRenderedValue():
2533
2534 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
2535 >>> status_widget.setRenderedValue(BugTaskStatus.CONFIRMED)
2536- >>> print status_widget()
2537+ >>> print(status_widget())
2538 <span class="statusCONFIRMED">Confirmed</span>
2539
2540=== modified file 'lib/lp/bugs/doc/bugtask-expiration.txt'
2541--- lib/lp/bugs/doc/bugtask-expiration.txt 2016-01-26 15:47:37 +0000
2542+++ lib/lp/bugs/doc/bugtask-expiration.txt 2018-06-30 11:02:51 +0000
2543@@ -392,7 +392,7 @@
2544 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks(
2545 ... 0, user=None, target=ubuntu)
2546 >>> visible_bugs = set(bugtask.bug for bugtask in expirable_bugtasks)
2547- >>> print sorted(bug.title for bug in visible_bugs)
2548+ >>> print(sorted(bug.title for bug in visible_bugs))
2549 [u'expirable_distro', u'recent']
2550
2551 If one of the bugs is set to private, anonymous users can no longer see
2552@@ -408,7 +408,7 @@
2553 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks(
2554 ... 0, user=None, target=ubuntu)
2555 >>> visible_bugs = set(bugtask.bug for bugtask in expirable_bugtasks)
2556- >>> print sorted(bug.title for bug in visible_bugs)
2557+ >>> print(sorted(bug.title for bug in visible_bugs))
2558 [u'recent']
2559
2560 No Privileges Person can't see the bug either...
2561@@ -418,7 +418,7 @@
2562 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks(
2563 ... 0, user=no_priv, target=ubuntu)
2564 >>> visible_bugs = set(bugtask.bug for bugtask in expirable_bugtasks)
2565- >>> print sorted(bug.title for bug in visible_bugs)
2566+ >>> print(sorted(bug.title for bug in visible_bugs))
2567 [u'recent']
2568
2569 ... unless they're subscribed to the bug.
2570@@ -429,7 +429,7 @@
2571 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks(
2572 ... 0, user=no_priv, target=ubuntu)
2573 >>> visible_bugs = set(bugtask.bug for bugtask in expirable_bugtasks)
2574- >>> print sorted(bug.title for bug in visible_bugs)
2575+ >>> print(sorted(bug.title for bug in visible_bugs))
2576 [u'expirable_distro', u'recent']
2577
2578 The Janitor needs to be able to access all bugs, even private ones, in
2579@@ -444,7 +444,7 @@
2580 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks(
2581 ... 0, user=janitor, target=ubuntu)
2582 >>> visible_bugs = set(bugtask.bug for bugtask in expirable_bugtasks)
2583- >>> print sorted(bug.title for bug in visible_bugs)
2584+ >>> print(sorted(bug.title for bug in visible_bugs))
2585 [u'expirable_distro', u'recent']
2586
2587 >>> private_bug.setPrivate(False, sample_person)
2588@@ -497,7 +497,7 @@
2589 ... stdin=subprocess.PIPE, stdout=subprocess.PIPE,
2590 ... stderr=subprocess.PIPE)
2591 >>> (out, err) = process.communicate()
2592- >>> print err
2593+ >>> print(err)
2594 INFO Creating lockfile: /var/lock/launchpad-expire-bugtasks.lock
2595 INFO Expiring unattended, INCOMPLETE bugtasks older than
2596 60 days for projects that use Launchpad Bugs.
2597@@ -505,7 +505,7 @@
2598 INFO Expired 2 bugtasks.
2599 INFO Finished expiration run.
2600 <BLANKLINE>
2601- >>> print out
2602+ >>> print(out)
2603 <BLANKLINE>
2604 >>> process.returncode
2605 0
2606@@ -546,18 +546,18 @@
2607 3
2608
2609 >>> message = hoary_bugtask.bug.messages[-1]
2610- >>> print message.owner.name
2611+ >>> print(message.owner.name)
2612 janitor
2613
2614- >>> print message.text_contents
2615+ >>> print(message.text_contents)
2616 [Expired for Ubuntu Hoary because there has been no activity for 60 days.]
2617
2618 The bug's activity log was updated too with the status change.
2619
2620 >>> activity = hoary_bugtask.bug.activity[-1]
2621- >>> print "%s %s %s %s" % (
2622+ >>> print("%s %s %s %s" % (
2623 ... activity.person.displayname, activity.whatchanged,
2624- ... activity.oldvalue, activity.newvalue)
2625+ ... activity.oldvalue, activity.newvalue))
2626 Launchpad Janitor Ubuntu Hoary: status Incomplete Expired
2627
2628
2629
2630=== modified file 'lib/lp/bugs/doc/bugtask-find-similar.txt'
2631--- lib/lp/bugs/doc/bugtask-find-similar.txt 2012-08-08 11:48:29 +0000
2632+++ lib/lp/bugs/doc/bugtask-find-similar.txt 2018-06-30 11:02:51 +0000
2633@@ -40,7 +40,7 @@
2634 >>> similar_bugs = getUtility(IBugTaskSet).findSimilar(
2635 ... test_person, "Can't display SVG", product=test_product)
2636 >>> for bugtask in similar_bugs:
2637- ... print bugtask.bug.title
2638+ ... print(bugtask.bug.title)
2639 SVG doesn't work
2640
2641
2642@@ -77,7 +77,7 @@
2643 ... test_person, "sandwiches",
2644 ... distribution=test_distro)
2645 >>> for bugtask in similar_bugs:
2646- ... print bugtask.bug.title
2647+ ... print(bugtask.bug.title)
2648 Nothing to do with cheese or sandwiches
2649 A bug about sandwiches
2650 This cheese sandwich should show up
2651@@ -111,7 +111,7 @@
2652 ... another_user, "sandwiches",
2653 ... distribution=test_distro)
2654 >>> for bugtask in similar_bugs:
2655- ... print bugtask.bug.title
2656+ ... print(bugtask.bug.title)
2657 A bug about sandwiches
2658 This cheese sandwich should show up
2659
2660@@ -138,7 +138,7 @@
2661 ... test_person, "cheese sandwiches show",
2662 ... distribution=test_distro)
2663 >>> for bugtask in similar_bugs:
2664- ... print bugtask.bug.title
2665+ ... print(bugtask.bug.title)
2666 Nothing to do with cheese or sandwiches
2667 This cheese sandwich should show up
2668
2669@@ -146,7 +146,7 @@
2670 ... test_person, "Nothing sandwich",
2671 ... distribution=test_distro)
2672 >>> for bugtask in similar_bugs:
2673- ... print bugtask.bug.title
2674+ ... print(bugtask.bug.title)
2675 Nothing to do with cheese or sandwiches
2676 A bug about sandwiches
2677 This cheese sandwich should show up
2678
2679=== modified file 'lib/lp/bugs/doc/bugtask-package-bugcounts.txt'
2680--- lib/lp/bugs/doc/bugtask-package-bugcounts.txt 2011-06-28 15:04:29 +0000
2681+++ lib/lp/bugs/doc/bugtask-package-bugcounts.txt 2018-06-30 11:02:51 +0000
2682@@ -20,8 +20,8 @@
2683 ... for key, value in sorted(package_count.items()):
2684 ... if IDistributionSourcePackage.providedBy(value):
2685 ... value = value.bugtargetdisplayname
2686- ... print "%s: %s" % (key, value)
2687- ... print # Blank line, to make output more readable.
2688+ ... print("%s: %s" % (key, value))
2689+ ... print() # Blank line, to make output more readable.
2690 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
2691 >>> debian = getUtility(IDistributionSet).getByName('debian')
2692 >>> packages = [
2693
2694=== modified file 'lib/lp/bugs/doc/bugtask-retrieval.txt'
2695--- lib/lp/bugs/doc/bugtask-retrieval.txt 2012-12-26 01:32:19 +0000
2696+++ lib/lp/bugs/doc/bugtask-retrieval.txt 2018-06-30 11:02:51 +0000
2697@@ -92,7 +92,7 @@
2698 Traceback (most recent call last):
2699 ...
2700 TypeError: ...
2701- >>> print task_set.getMultiple(['1; DROP TABLE person;'])
2702+ >>> print(task_set.getMultiple(['1; DROP TABLE person;']))
2703 Traceback (most recent call last):
2704 ...
2705 ValueError: ...
2706
2707=== modified file 'lib/lp/bugs/doc/bugtask-search-old-urls.txt'
2708--- lib/lp/bugs/doc/bugtask-search-old-urls.txt 2014-11-29 01:33:59 +0000
2709+++ lib/lp/bugs/doc/bugtask-search-old-urls.txt 2018-06-30 11:02:51 +0000
2710@@ -39,13 +39,14 @@
2711 ... )
2712 >>> query_string_rewritten = (
2713 ... rewrite_old_bugtask_status_query_string(query_string))
2714- >>> print query_string_rewritten.split('&')
2715- ['freddy=krueger',
2716- 'field.status%3Alist=New',
2717- 'field.status%3Alist=Incomplete',
2718- 'field.status%3Alist=Invalid',
2719- 'field.status%3Alist=Fix+Committed',
2720- 'sid=nancy']
2721+ >>> for param in query_string_rewritten.split('&'):
2722+ ... print(param)
2723+ freddy=krueger
2724+ field.status%3Alist=New
2725+ field.status%3Alist=Incomplete
2726+ field.status%3Alist=Invalid
2727+ field.status%3Alist=Fix+Committed
2728+ sid=nancy
2729
2730 If the url does not contain any old statuses
2731 rewrite_old_bugtask_status_query_string returns the original query
2732
2733=== modified file 'lib/lp/bugs/doc/bugtask-search.txt'
2734--- lib/lp/bugs/doc/bugtask-search.txt 2016-01-26 15:47:37 +0000
2735+++ lib/lp/bugs/doc/bugtask-search.txt 2018-06-30 11:02:51 +0000
2736@@ -46,7 +46,7 @@
2737
2738 >>> found_bugtasks = firefox.searchTasks(text_search)
2739 >>> for bugtask in found_bugtasks:
2740- ... print "#%s" % bugtask.bug.id
2741+ ... print("#%s" % bugtask.bug.id)
2742 #4
2743
2744 === BugTaskSearchParams' parameters searchtext and fast_searchtext ===
2745@@ -62,7 +62,7 @@
2746 ... user=None, searchtext=u'happens pretty often')
2747 >>> found_bugtasks = firefox.searchTasks(good_search)
2748 >>> for bugtask in found_bugtasks:
2749- ... print "#%s" % bugtask.bug.id
2750+ ... print("#%s" % bugtask.bug.id)
2751 #4
2752
2753 The unstemmed word "happens" does not yield any results when used
2754@@ -71,7 +71,7 @@
2755 >>> bad_search = BugTaskSearchParams(
2756 ... user=None, fast_searchtext=u'happens')
2757 >>> found_bugtasks = firefox.searchTasks(bad_search)
2758- >>> print found_bugtasks.count()
2759+ >>> print(found_bugtasks.count())
2760 0
2761
2762 If the stem of "happens" is used, we get results.
2763@@ -80,7 +80,7 @@
2764 ... user=None, fast_searchtext=u'happen')
2765 >>> found_bugtasks = firefox.searchTasks(good_search)
2766 >>> for bugtask in found_bugtasks:
2767- ... print "#%s" % bugtask.bug.id
2768+ ... print("#%s" % bugtask.bug.id)
2769 #4
2770 #6
2771
2772@@ -90,7 +90,7 @@
2773 ... user=None, fast_searchtext=u'happen&pretti&often')
2774 >>> found_bugtasks = firefox.searchTasks(good_search)
2775 >>> for bugtask in found_bugtasks:
2776- ... print "#%s" % bugtask.bug.id
2777+ ... print("#%s" % bugtask.bug.id)
2778 #4
2779
2780 Passing invalid tsquery expressions as fast_searchtext raises an exception.
2781@@ -157,7 +157,7 @@
2782 ... user=None, hardware_bus=HWBus.PCI, hardware_vendor_id='0x10de',
2783 ... hardware_product_id='0x0455', hardware_owner_is_bug_reporter=True)
2784 >>> for bugtask in ubuntu.searchTasks(search_params):
2785- ... print bugtask.bug.title
2786+ ... print(bugtask.bug.title)
2787 Firefox does not support SVG
2788 Blackhole Trash folder
2789
2790@@ -170,7 +170,7 @@
2791 ... user=None, hardware_bus=HWBus.PCI, hardware_vendor_id='0x10de',
2792 ... hardware_owner_is_bug_reporter=True)
2793 >>> for bugtask in ubuntu.searchTasks(search_params):
2794- ... print bugtask.bug.title
2795+ ... print(bugtask.bug.title)
2796 Firefox does not support SVG
2797 Thunderbird crashes
2798 another test bug
2799@@ -184,7 +184,7 @@
2800 ... user=None, hardware_driver_name='ehci_hcd',
2801 ... hardware_owner_is_bug_reporter=True)
2802 >>> for bugtask in ubuntu.searchTasks(search_params):
2803- ... print bugtask.bug.id, bugtask.bug.owner.displayname
2804+ ... print(bugtask.bug.id, bugtask.bug.owner.displayname)
2805 1 Sample Person
2806 2 Sample Person
2807
2808@@ -195,7 +195,7 @@
2809 ... hardware_driver_package_name='linux-image-2.6.24-19-generic',
2810 ... hardware_owner_is_bug_reporter=True)
2811 >>> for bugtask in ubuntu.searchTasks(search_params):
2812- ... print bugtask.bug.id, bugtask.bug.owner.displayname
2813+ ... print(bugtask.bug.id, bugtask.bug.owner.displayname)
2814 1 Sample Person
2815 2 Sample Person
2816
2817@@ -214,7 +214,7 @@
2818 ... hardware_product_id='0x0455', hardware_driver_name='ehci_hcd',
2819 ... hardware_owner_is_bug_reporter=True)
2820 >>> for bugtask in ubuntu.searchTasks(search_params):
2821- ... print bugtask.bug.id, bugtask.bug.owner.displayname
2822+ ... print(bugtask.bug.id, bugtask.bug.owner.displayname)
2823 1 Sample Person
2824 2 Sample Person
2825
2826@@ -239,7 +239,7 @@
2827 ... hardware_product_id='0x0455',
2828 ... hardware_owner_is_subscribed_to_bug=True)
2829 >>> for bugtask in ubuntu.searchTasks(search_params):
2830- ... print bugtask.bug.id, bugtask.bug.isSubscribed(sample_person)
2831+ ... print(bugtask.bug.id, bugtask.bug.isSubscribed(sample_person))
2832 1 True
2833 9 True
2834
2835@@ -252,7 +252,7 @@
2836 ... hardware_product_id='0x0455',
2837 ... hardware_owner_is_affected_by_bug=True)
2838 >>> for bugtask in ubuntu.searchTasks(search_params):
2839- ... print bugtask.bug.id, bugtask.bug.isUserAffected(sample_person)
2840+ ... print(bugtask.bug.id, bugtask.bug.isUserAffected(sample_person))
2841 10 True
2842
2843 Finally, we can search for who bugs which are directly linked to
2844@@ -323,7 +323,7 @@
2845 ... orderby='-number_of_duplicates', user=None)
2846 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2847 >>> for bugtask in ubuntu_tasks:
2848- ... print bugTaskInfo(bugtask)
2849+ ... print(bugTaskInfo(bugtask))
2850 mozilla-firefox (Ubuntu) Firefox does not support SVG
2851 thunderbird (Ubuntu) Thunderbird crashes
2852 linux-source-2.6.15 (Ubuntu) another test bug
2853@@ -350,7 +350,7 @@
2854
2855 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2856 >>> for bugtask in ubuntu_tasks:
2857- ... print bugTaskInfo(bugtask)
2858+ ... print(bugTaskInfo(bugtask))
2859 thunderbird (Ubuntu) Thunderbird crashes
2860 mozilla-firefox (Ubuntu) Firefox does not support SVG
2861 linux-source-2.6.15 (Ubuntu) another test bug
2862@@ -369,7 +369,7 @@
2863 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2864 >>> for bugtask in ubuntu_tasks:
2865 ... bug = bugtask.bug
2866- ... print '%s [%s comments]' % (bug.title, bug.message_count)
2867+ ... print('%s [%s comments]' % (bug.title, bug.message_count))
2868 Blackhole Trash folder [3 comments]
2869 Firefox does not support SVG [2 comments]
2870 another test bug [2 comments]
2871@@ -392,7 +392,7 @@
2872 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2873 >>> for bugtask in ubuntu_tasks:
2874 ... bug = bugtask.bug
2875- ... print '%s [heat: %s]' % (bug.title, bug.heat)
2876+ ... print('%s [heat: %s]' % (bug.title, bug.heat))
2877 Bug to be fixed in trunk [heat: 16]
2878 another test bug [heat: 10]
2879 Thunderbird crashes [heat: 9]
2880@@ -413,7 +413,7 @@
2881 ... orderby='latest_patch_uploaded', user=None)
2882 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2883 >>> for bugtask in ubuntu_tasks:
2884- ... print bugTaskInfo(bugtask)
2885+ ... print(bugTaskInfo(bugtask))
2886 cdrkit (Ubuntu) Bug to be fixed in trunk
2887 Ubuntu Blackhole Trash folder
2888 linux-source-2.6.15 (Ubuntu) another test bug
2889@@ -432,7 +432,7 @@
2890 ... orderby='latest_patch_uploaded', user=None)
2891 >>> ubuntu_tasks = ubuntu.searchTasks(params)
2892 >>> for bugtask in ubuntu_tasks:
2893- ... print bugTaskInfo(bugtask)
2894+ ... print(bugTaskInfo(bugtask))
2895 Ubuntu Blackhole Trash folder
2896 linux-source-2.6.15 (Ubuntu) another test bug
2897 cdrkit (Ubuntu) Bug to be fixed in trunk
2898
2899=== modified file 'lib/lp/bugs/doc/bugtask-status-changes.txt'
2900--- lib/lp/bugs/doc/bugtask-status-changes.txt 2012-09-07 21:00:46 +0000
2901+++ lib/lp/bugs/doc/bugtask-status-changes.txt 2018-06-30 11:02:51 +0000
2902@@ -20,7 +20,7 @@
2903 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
2904 >>> ignored = login_person(owner)
2905 >>> bugtask.transitionToStatus(BugTaskStatus.WONTFIX, owner)
2906- >>> print bugtask.status.title
2907+ >>> print(bugtask.status.title)
2908 Won't Fix
2909
2910 Regular users of Launchpad cannot transition a bug task to any of
2911
2912=== modified file 'lib/lp/bugs/doc/bugtask-status-workflow.txt'
2913--- lib/lp/bugs/doc/bugtask-status-workflow.txt 2011-12-24 17:49:30 +0000
2914+++ lib/lp/bugs/doc/bugtask-status-workflow.txt 2018-06-30 11:02:51 +0000
2915@@ -27,9 +27,9 @@
2916
2917 >>> ubuntu_firefox_task = new_bug.bugtasks[0]
2918
2919- >>> print ubuntu_firefox_task.distribution.name
2920+ >>> print(ubuntu_firefox_task.distribution.name)
2921 ubuntu
2922- >>> print ubuntu_firefox_task.sourcepackagename.name
2923+ >>> print(ubuntu_firefox_task.sourcepackagename.name)
2924 mozilla-firefox
2925
2926 Only its datecreated value will be set. All other dates will be None.
2927@@ -59,7 +59,7 @@
2928 ...
2929 ForbiddenAttribute: ...
2930
2931- >>> print ubuntu_firefox_task.status.title
2932+ >>> print(ubuntu_firefox_task.status.title)
2933 New
2934
2935 Confirming the bug will set IBugTask.date_confirmed. As with all the
2936@@ -71,7 +71,7 @@
2937 >>> ubuntu_firefox_task.transitionToStatus(
2938 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
2939
2940- >>> print ubuntu_firefox_task.status.title
2941+ >>> print(ubuntu_firefox_task.status.title)
2942 Confirmed
2943 >>> ubuntu_firefox_task.date_confirmed
2944 datetime.datetime...
2945@@ -122,7 +122,7 @@
2946 >>> ubuntu_firefox_task.transitionToStatus(
2947 ... BugTaskStatus.INPROGRESS, getUtility(ILaunchBag).user)
2948
2949- >>> print ubuntu_firefox_task.status.title
2950+ >>> print(ubuntu_firefox_task.status.title)
2951 In Progress
2952 >>> ubuntu_firefox_task.date_inprogress
2953 datetime.datetime...
2954@@ -148,7 +148,7 @@
2955
2956 Marking the bug Triaged sets `date_triaged`.
2957
2958- >>> print ubuntu_firefox_task.date_triaged
2959+ >>> print(ubuntu_firefox_task.date_triaged)
2960 None
2961
2962 >>> ubuntu_firefox_task.transitionToStatus(
2963@@ -162,7 +162,7 @@
2964 >>> ubuntu_firefox_task.transitionToStatus(
2965 ... BugTaskStatus.NEW, getUtility(ILaunchBag).user)
2966
2967- >>> print ubuntu_firefox_task.date_triaged
2968+ >>> print(ubuntu_firefox_task.date_triaged)
2969 None
2970
2971 If the status is changed from any unresolved status to any resolved
2972@@ -211,13 +211,13 @@
2973 Changing from one closed status to another does not change the
2974 date_closed.
2975
2976- >>> print ubuntu_firefox_task.status.title
2977+ >>> print(ubuntu_firefox_task.status.title)
2978 Fix Released
2979 >>> prev_date_closed = ubuntu_firefox_task.date_closed
2980 >>> ubuntu_firefox_task.transitionToStatus(
2981 ... BugTaskStatus.INVALID, getUtility(ILaunchBag).user)
2982
2983- >>> print ubuntu_firefox_task.status.title
2984+ >>> print(ubuntu_firefox_task.status.title)
2985 Invalid
2986 >>> ubuntu_firefox_task.date_closed == prev_date_closed
2987 True
2988@@ -235,7 +235,7 @@
2989
2990 We also record the date a task was marked Fix Commited.
2991
2992- >>> print ubuntu_firefox_task.date_fix_committed
2993+ >>> print(ubuntu_firefox_task.date_fix_committed)
2994 None
2995
2996 >>> ubuntu_firefox_task.transitionToStatus(
2997@@ -249,12 +249,12 @@
2998 >>> ubuntu_firefox_task.transitionToStatus(
2999 ... BugTaskStatus.INPROGRESS, getUtility(ILaunchBag).user)
3000
3001- >>> print ubuntu_firefox_task.date_fix_committed
3002+ >>> print(ubuntu_firefox_task.date_fix_committed)
3003 None
3004
3005 We also record the date a task was marked Fix Released.
3006
3007- >>> print ubuntu_firefox_task.date_fix_released
3008+ >>> print(ubuntu_firefox_task.date_fix_released)
3009 None
3010
3011 >>> ubuntu_firefox_task.transitionToStatus(
3012@@ -268,7 +268,7 @@
3013 >>> ubuntu_firefox_task.transitionToStatus(
3014 ... BugTaskStatus.INPROGRESS, getUtility(ILaunchBag).user)
3015
3016- >>> print ubuntu_firefox_task.date_fix_committed
3017+ >>> print(ubuntu_firefox_task.date_fix_committed)
3018 None
3019
3020 Lastly, IBugTask.date_assigned is set when a bugtask goes from being
3021
3022=== modified file 'lib/lp/bugs/doc/bugtracker-person.txt'
3023--- lib/lp/bugs/doc/bugtracker-person.txt 2017-10-24 13:08:32 +0000
3024+++ lib/lp/bugs/doc/bugtracker-person.txt 2018-06-30 11:02:51 +0000
3025@@ -27,13 +27,13 @@
3026 >>> bugtracker_person = bugtracker.linkPersonToSelf(
3027 ... 'some-name-i-made-up', sample_person)
3028
3029- >>> print bugtracker_person.name
3030+ >>> print(bugtracker_person.name)
3031 some-name-i-made-up
3032
3033- >>> print bugtracker_person.person.name
3034+ >>> print(bugtracker_person.person.name)
3035 name12
3036
3037- >>> print bugtracker_person.bugtracker.name
3038+ >>> print(bugtracker_person.bugtracker.name)
3039 bugzilla-checkwatches
3040
3041 A name can only be registered with a bugtracker once. Trying to link a
3042@@ -53,10 +53,10 @@
3043 >>> bugtracker_person = bugtracker.getLinkedPersonByName(
3044 ... 'some-name-i-made-up')
3045
3046- >>> print bugtracker_person.name
3047+ >>> print(bugtracker_person.name)
3048 some-name-i-made-up
3049
3050- >>> print bugtracker_person.person.name
3051+ >>> print(bugtracker_person.person.name)
3052 name12
3053
3054
3055@@ -73,7 +73,7 @@
3056 >>> from lp.registry.interfaces.person import (
3057 ... PersonCreationRationale)
3058
3059- >>> print getUtility(IPersonSet).getByEmail('new.person@example.com')
3060+ >>> print(getUtility(IPersonSet).getByEmail('new.person@example.com'))
3061 None
3062
3063 >>> new_person = bugtracker.ensurePersonForSelf(
3064@@ -81,7 +81,7 @@
3065 ... rationale=PersonCreationRationale.BUGIMPORT,
3066 ... creation_comment='whilst testing ensurePersonForSelf().')
3067
3068- >>> print new_person.displayname
3069+ >>> print(new_person.displayname)
3070 New Person
3071
3072 There won't be a BugTrackerPerson record linking 'New Person' to the
3073@@ -90,7 +90,7 @@
3074 remote bugtracker.
3075
3076 >>> bugtracker_person = bugtracker.getLinkedPersonByName('New Person')
3077- >>> print bugtracker_person
3078+ >>> print(bugtracker_person)
3079 None
3080
3081 Calling ensurePersonForSelf() with the same details will return the
3082@@ -102,10 +102,10 @@
3083 ... rationale=PersonCreationRationale.BUGIMPORT,
3084 ... creation_comment='whilst testing ensurePersonForSelf().')
3085
3086- >>> print other_person.name
3087+ >>> print(other_person.name)
3088 new-person
3089
3090- >>> print new_person.name
3091+ >>> print(new_person.name)
3092 new-person
3093
3094 ensurePersonForSelf() can also handle remote users whose email
3095@@ -116,7 +116,7 @@
3096 ... email=None, rationale=PersonCreationRationale.BUGIMPORT,
3097 ... creation_comment='whilst testing ensurePersonForSelf().')
3098
3099- >>> print noemail_person.name
3100+ >>> print(noemail_person.name)
3101 no-email-person-bugzilla-checkwatches
3102
3103 A BugTrackerPerson record will have been created to map
3104@@ -139,15 +139,15 @@
3105 ... email=None, rationale=PersonCreationRationale.BUGIMPORT,
3106 ... creation_comment='whilst testing.')
3107
3108- >>> print new_person.name
3109+ >>> print(new_person.name)
3110 noemail-bugzilla-checkwatches
3111
3112 >>> bugtracker_person = bugtracker.getLinkedPersonByName('noemail')
3113
3114- >>> print bugtracker_person.bugtracker.name
3115+ >>> print(bugtracker_person.bugtracker.name)
3116 bugzilla-checkwatches
3117
3118- >>> print bugtracker_person.person.name
3119+ >>> print(bugtracker_person.person.name)
3120 noemail-bugzilla-checkwatches
3121
3122 >>> transaction.commit()
3123@@ -178,9 +178,9 @@
3124 ... 'noemail', None, PersonCreationRationale.BUGIMPORT,
3125 ... 'while testing, again')
3126
3127- >>> print original_bugtracker_person.person.name
3128+ >>> print(original_bugtracker_person.person.name)
3129 noemail-bugzilla-checkwatches
3130
3131- >>> print new_person.name
3132+ >>> print(new_person.name)
3133 noemail-bugzilla-checkwatches-1
3134
3135
3136=== modified file 'lib/lp/bugs/doc/bugtracker-tokens.txt'
3137--- lib/lp/bugs/doc/bugtracker-tokens.txt 2012-12-20 13:43:48 +0000
3138+++ lib/lp/bugs/doc/bugtracker-tokens.txt 2018-06-30 11:02:51 +0000
3139@@ -27,7 +27,7 @@
3140 ... token, request=test_request, rootsite='mainsite',
3141 ... view_name='+bugtracker-handshake')
3142
3143- >>> print token_url
3144+ >>> print(token_url)
3145 http://launchpad.dev/token/.../+bugtracker-handshake
3146
3147 Visiting the token's +bugtracker-handshake URL will result in an HTTP
3148@@ -39,13 +39,13 @@
3149 >>> view()
3150 'Handshake token validated.'
3151
3152- >>> print test_request.response.getStatus()
3153+ >>> print(test_request.response.getStatus())
3154 200
3155
3156 The token has now been consumed.
3157
3158 >>> token = getUtility(ILoginTokenSet)[token_string]
3159- >>> print token.date_consumed is not None
3160+ >>> print(token.date_consumed is not None)
3161 True
3162
3163 If we try to access the +bugtracker-handshake URL again, we will receive
3164@@ -56,7 +56,7 @@
3165 >>> view()
3166 'Token has already been used or is invalid.'
3167
3168- >>> print test_request.response.getStatus()
3169+ >>> print(test_request.response.getStatus())
3170 410
3171
3172 Only POST requests are valid when accessing a +bugtracker-handshake URL.
3173@@ -72,12 +72,12 @@
3174 >>> view()
3175 'Only POST requests are accepted for bugtracker handshakes.'
3176
3177- >>> print test_request.response.getStatus()
3178+ >>> print(test_request.response.getStatus())
3179 405
3180
3181 However, since the request was invalid the token will not have been
3182 consumed.
3183
3184 >>> token = getUtility(ILoginTokenSet)[token_string]
3185- >>> print token.date_consumed
3186+ >>> print(token.date_consumed)
3187 None
3188
3189=== modified file 'lib/lp/bugs/doc/bugtracker.txt'
3190--- lib/lp/bugs/doc/bugtracker.txt 2011-12-30 06:14:56 +0000
3191+++ lib/lp/bugs/doc/bugtracker.txt 2018-06-30 11:02:51 +0000
3192@@ -20,8 +20,8 @@
3193 ... key=lambda watch: (watch.remotebug, watch.bug.id))
3194 ...
3195 ... for bug_watch in watches:
3196- ... print "Remote bug: %s LP bug: %s" % (
3197- ... bug_watch.remotebug, bug_watch.bug.id)
3198+ ... print("Remote bug: %s LP bug: %s" % (
3199+ ... bug_watch.remotebug, bug_watch.bug.id))
3200
3201 We must be an admin to modify bug watches later on.
3202
3203@@ -32,25 +32,25 @@
3204 next_check time is in the past.
3205
3206 >>> bug_watches = mozilla_bugzilla.watches
3207- >>> print bug_watches.count()
3208+ >>> print(bug_watches.count())
3209 4
3210
3211- >>> print bug_watches[0].remotebug, bug_watches[0].bug.id
3212+ >>> print(bug_watches[0].remotebug, bug_watches[0].bug.id)
3213 2000 1
3214 >>> bug_watches[0].next_check = now - timedelta(hours=1)
3215
3216- >>> print bug_watches[1].remotebug, bug_watches[1].bug.id
3217+ >>> print(bug_watches[1].remotebug, bug_watches[1].bug.id)
3218 123543 1
3219 >>> bug_watches[1].lastchecked = now - timedelta(hours=12)
3220
3221 Note that bugtracker.watches may produce multiple watches for the same
3222 remote bug.
3223
3224- >>> print bug_watches[2].remotebug, bug_watches[2].bug.id
3225+ >>> print(bug_watches[2].remotebug, bug_watches[2].bug.id)
3226 42 1
3227 >>> bug_watches[2].next_check = now - timedelta(hours=36)
3228
3229- >>> print bug_watches[3].remotebug, bug_watches[3].bug.id
3230+ >>> print(bug_watches[3].remotebug, bug_watches[3].bug.id)
3231 42 2
3232 >>> bug_watches[3].next_check = now - timedelta(days=1)
3233
3234@@ -74,7 +74,7 @@
3235 >>> message = factory.makeMessage(
3236 ... 'Unpushed comment', '... is unpushed')
3237
3238- >>> print bug_watches[1].remotebug
3239+ >>> print(bug_watches[1].remotebug)
3240 123543
3241
3242 >>> bug_message = bug_watches[1].addComment(None, message)
3243@@ -268,7 +268,7 @@
3244 >>> trackers = list(bugtracker_set)
3245 >>> pillars = bugtracker_set.getPillarsForBugtrackers(trackers)
3246 >>> for t in pillars:
3247- ... print t.name, [p.name for p in pillars[t]]
3248+ ... print(t.name, [p.name for p in pillars[t]])
3249 gnome-bugzilla [u'gnome-terminal', u'gnome']
3250
3251
3252@@ -280,9 +280,9 @@
3253
3254 >>> def print_bug_messages(bug_messages):
3255 ... for bug_message in bug_messages:
3256- ... print '* bug: %d' % bug_message.bug.id
3257- ... print '- remote bug: %s' % bug_message.bugwatch.remotebug
3258- ... print '- message subject: %s' % bug_message.message.subject
3259+ ... print('* bug: %d' % bug_message.bug.id)
3260+ ... print('- remote bug: %s' % bug_message.bugwatch.remotebug)
3261+ ... print('- message subject: %s' % bug_message.message.subject)
3262
3263 The Mozilla Bugzilla has only one imported bug message.
3264
3265@@ -330,7 +330,7 @@
3266
3267 >>> def print_links(links_dict):
3268 ... for key in sorted(links_dict):
3269- ... print "%s: %s" % (key, links_dict[key])
3270+ ... print("%s: %s" % (key, links_dict[key]))
3271
3272 >>> links = mozilla_bugzilla.getBugFilingAndSearchLinks(
3273 ... remote_product='testproduct', summary="Foo", description="Bar")
3274@@ -506,13 +506,13 @@
3275 Our example Trac bug tracker's `multi_product` property will be False,
3276 since it only tracks one product at a time.
3277
3278- >>> print example_trac.multi_product
3279+ >>> print(example_trac.multi_product)
3280 False
3281
3282 However, Bugzilla instances require remote products in order to be able
3283 to return a bug filing URL.
3284
3285- >>> print mozilla_bugzilla.multi_product
3286+ >>> print(mozilla_bugzilla.multi_product)
3287 True
3288
3289 There is a test in database/tests/test_bugtracker.py that checks that
3290
3291=== modified file 'lib/lp/bugs/doc/bugwatch.txt'
3292--- lib/lp/bugs/doc/bugwatch.txt 2018-06-22 21:56:16 +0000
3293+++ lib/lp/bugs/doc/bugwatch.txt 2018-06-30 11:02:51 +0000
3294@@ -184,7 +184,7 @@
3295 ... (bug_watch.bugtracker.bugtrackertype, bug_watch.remotebug)
3296 ... for bug_watch in bug_watches]
3297 >>> for bugtracker_type, remotebug in sorted(bugs_and_types):
3298- ... print "%s: %s" % (bugtracker_type.name, remotebug)
3299+ ... print("%s: %s" % (bugtracker_type.name, remotebug))
3300 BUGZILLA: 42
3301 DEBBUGS: 42
3302 ROUNDUP: 42
3303@@ -239,13 +239,13 @@
3304 >>> bug_watch_updater_user = getUtility(ILaunchBag).user
3305 >>> bug_one = getUtility(IBugSet).get(1)
3306 >>> bug_one.expireNotifications()
3307- >>> print len(bug_one.bugtasks)
3308+ >>> print(len(bug_one.bugtasks))
3309 3
3310 >>> debian_task = bug_one.bugtasks[2]
3311- >>> print debian_task.bugtargetdisplayname
3312+ >>> print(debian_task.bugtargetdisplayname)
3313 mozilla-firefox (Debian)
3314
3315- >>> print debian_task.status.title
3316+ >>> print(debian_task.status.title)
3317 Confirmed
3318
3319 >>> debian_bugwatch = debian_task.bugwatch
3320@@ -258,11 +258,11 @@
3321 >>> def print_bugtask_modified(bugtask, event):
3322 ... old_bugtask = event.object_before_modification
3323 ... if bugtask.status != old_bugtask.status:
3324- ... print "%s => %s" % (old_bugtask.status.title,
3325- ... bugtask.status.title)
3326+ ... print("%s => %s" % (old_bugtask.status.title,
3327+ ... bugtask.status.title))
3328 ... if bugtask.importance != old_bugtask.importance:
3329- ... print "%s => %s" % (old_bugtask.importance.title,
3330- ... bugtask.importance.title)
3331+ ... print("%s => %s" % (old_bugtask.importance.title,
3332+ ... bugtask.importance.title))
3333 >>> from lp.testing.event import TestEventListener
3334 >>> from lazr.lifecycle.interfaces import IObjectModifiedEvent
3335 >>> from lp.bugs.interfaces.bugtask import IBugTask
3336@@ -288,7 +288,7 @@
3337
3338 >>> debian_bugwatch.remotestatus == old_remotestatus
3339 True
3340- >>> print debian_task.status.title
3341+ >>> print(debian_task.status.title)
3342 New
3343
3344 If only the remote status is changed, not the bugtask's status, no
3345@@ -299,7 +299,7 @@
3346
3347 >>> debian_bugwatch.remotestatus
3348 u'some status'
3349- >>> print debian_task.status.title
3350+ >>> print(debian_task.status.title)
3351 New
3352
3353 The lastchanged was updated, though.
3354@@ -322,10 +322,10 @@
3355 ... BugNotification.selectBy(date_emailed=None, orderBy='id'))
3356
3357 >>> for bug_notification in unsent_notifications:
3358- ... print "Bug %s changed by %s:" % (
3359+ ... print("Bug %s changed by %s:" % (
3360 ... bug_notification.bug.id,
3361- ... bug_notification.message.owner.displayname)
3362- ... print bug_notification.message.text_contents
3363+ ... bug_notification.message.owner.displayname))
3364+ ... print(bug_notification.message.text_contents)
3365 Bug 1 changed by Bug Watch Updater:
3366 ** Changed in: mozilla-firefox (Debian)
3367 Status: Confirmed => New
3368@@ -356,7 +356,7 @@
3369 >>> debian_bugwatch.remote_importance == old_remote_importance
3370 True
3371
3372- >>> print debian_task.importance.title
3373+ >>> print(debian_task.importance.title)
3374 Critical
3375
3376 If only the remote importance is changed, not the bugtask's importance,
3377@@ -368,7 +368,7 @@
3378
3379 >>> debian_bugwatch.remote_importance
3380 u'some importance'
3381- >>> print debian_task.importance.title
3382+ >>> print(debian_task.importance.title)
3383 Critical
3384
3385 The `lastchanged` field was updated, though.
3386@@ -380,10 +380,10 @@
3387 manner:
3388
3389 >>> for bug_notification in unsent_notifications:
3390- ... print "Bug %s changed by %s:" % (
3391+ ... print("Bug %s changed by %s:" % (
3392 ... bug_notification.bug.id,
3393- ... bug_notification.message.owner.displayname)
3394- ... print bug_notification.message.text_contents
3395+ ... bug_notification.message.owner.displayname))
3396+ ... print(bug_notification.message.text_contents)
3397 Bug 1 changed by Bug Watch Updater:
3398 ** Changed in: mozilla-firefox (Debian)
3399 Status: Confirmed => New
3400
3401=== modified file 'lib/lp/bugs/doc/checkwatches-batching.txt'
3402--- lib/lp/bugs/doc/checkwatches-batching.txt 2016-02-05 16:51:12 +0000
3403+++ lib/lp/bugs/doc/checkwatches-batching.txt 2018-06-30 11:02:51 +0000
3404@@ -74,8 +74,8 @@
3405 >>> class QueryableRemoteSystem:
3406 ... sync_comments = False
3407 ... def getModifiedRemoteBugs(self, remote_bug_ids, timestamp):
3408- ... print "getModifiedRemoteBugs(%r, %r)" % (
3409- ... remote_bug_ids, timestamp)
3410+ ... print("getModifiedRemoteBugs(%r, %r)" % (
3411+ ... remote_bug_ids, timestamp))
3412 ... # Return every *other* bug ID for demo purposes.
3413 ... return remote_bug_ids[::2]
3414
3415
3416=== modified file 'lib/lp/bugs/doc/checkwatches-cli-switches.txt'
3417--- lib/lp/bugs/doc/checkwatches-cli-switches.txt 2012-01-20 15:42:44 +0000
3418+++ lib/lp/bugs/doc/checkwatches-cli-switches.txt 2018-06-30 11:02:51 +0000
3419@@ -121,7 +121,7 @@
3420 ... stdin=subprocess.PIPE, stdout=subprocess.PIPE,
3421 ... stderr=subprocess.PIPE)
3422 >>> (out, err) = process.communicate()
3423- >>> print out
3424+ >>> print(out)
3425 Usage: checkwatches.py [options]
3426 <BLANKLINE>
3427 Options:
3428
3429=== modified file 'lib/lp/bugs/doc/checkwatches.txt'
3430--- lib/lp/bugs/doc/checkwatches.txt 2018-06-22 21:56:16 +0000
3431+++ lib/lp/bugs/doc/checkwatches.txt 2018-06-30 11:02:51 +0000
3432@@ -223,8 +223,8 @@
3433 since that's the error that was raised during the update.
3434
3435 >>> for watch in savannah.watches:
3436- ... print "%s, %s" % (
3437- ... watch.lastchecked is not None, watch.last_error_type.title)
3438+ ... print("%s, %s" % (
3439+ ... watch.lastchecked is not None, watch.last_error_type.title))
3440 True, Unsupported Bugtracker
3441
3442 If a bug tracker doesn't have any watches to update, forceUpdateAll()
3443@@ -331,22 +331,22 @@
3444 ... return BugTaskImportance.UNKNOWN
3445 ...
3446 ... def getCommentIds(self, bug_watch):
3447- ... print "getCommentIds() called"
3448+ ... print("getCommentIds() called")
3449 ... return []
3450 ...
3451 ... def fetchComments(self, bug_watch, comment_ids):
3452 ... return []
3453 ...
3454 ... def addRemoteComment(self, bug_watch, comment):
3455- ... print "addRemoteComment() called."
3456+ ... print("addRemoteComment() called.")
3457 ... return 0
3458 ...
3459 ... def getLaunchpadBugId(self, bug_id):
3460- ... print "getLaunchpadBugId() called"
3461+ ... print("getLaunchpadBugId() called")
3462 ... return None
3463 ...
3464 ... def setLaunchpadBugId(self, bug_id, lp_bug_id, lp_bug_url):
3465- ... print "setLaunchpadBugId() called"
3466+ ... print("setLaunchpadBugId() called")
3467
3468 We'll generate a bug watch with which to test this. The bug watch must
3469 be associated with at least one bug task to enable syncing.
3470
3471=== modified file 'lib/lp/bugs/doc/cve-update.txt'
3472--- lib/lp/bugs/doc/cve-update.txt 2016-08-16 15:27:19 +0000
3473+++ lib/lp/bugs/doc/cve-update.txt 2018-06-30 11:02:51 +0000
3474@@ -25,7 +25,7 @@
3475 entries are in the database.
3476
3477 >>> from lp.bugs.model.cve import Cve
3478- >>> print Cve.select().count()
3479+ >>> print(Cve.select().count())
3480 10
3481
3482 >>> script = os.path.join(config.root, 'cronscripts', 'update-cve.py')
3483@@ -51,7 +51,7 @@
3484 ... shutil.rmtree(tempdir)
3485
3486 >>> output, empty = update_from_file(os.path.join(base, 'cvedb_init.xml'))
3487- >>> print output
3488+ >>> print(output)
3489 INFO Creating lockfile: /var/lock/launchpad-updatecve.lock
3490 ...
3491 INFO CVE-1999-0002 created
3492@@ -81,7 +81,7 @@
3493 And let's make sure we got the right number of CVE entries.
3494
3495 >>> transaction.commit()
3496- >>> print Cve.select().count()
3497+ >>> print(Cve.select().count())
3498 18
3499
3500 We will make a note of the CVE modification time of 1999-0002. When we
3501@@ -94,14 +94,14 @@
3502 And while we are here, make a note of the number of references for that CVE
3503 entry.
3504
3505- >>> print c.references.count()
3506+ >>> print(c.references.count())
3507 6
3508
3509 Now, let's run an import of the update db.
3510
3511 >>> output, empty = update_from_file(
3512 ... os.path.join(base, 'cvedb_update.xml'))
3513- >>> print output
3514+ >>> print(output)
3515 INFO Creating lockfile: /var/lock/launchpad-updatecve.lock
3516 ...
3517 INFO Creating new CERT reference for 1999-0002
3518@@ -137,16 +137,16 @@
3519 Let's make sure we got the new CVE's.
3520
3521 >>> transaction.commit()
3522- >>> print Cve.select().count()
3523+ >>> print(Cve.select().count())
3524 21
3525
3526 And let's make sure the modification time of 2005-2734 was updated, as were
3527 the number of comments.
3528
3529 >>> c.sync()
3530- >>> print mod_time < c.datemodified
3531+ >>> print(mod_time < c.datemodified)
3532 True
3533- >>> print c.references.count()
3534+ >>> print(c.references.count())
3535 0
3536
3537
3538
3539=== modified file 'lib/lp/bugs/doc/cve.txt'
3540--- lib/lp/bugs/doc/cve.txt 2017-05-31 17:31:58 +0000
3541+++ lib/lp/bugs/doc/cve.txt 2018-06-30 11:02:51 +0000
3542@@ -70,7 +70,7 @@
3543 >>> from lp.bugs.model.bug import Bug
3544 >>> b = Bug.get(1)
3545 >>> for c in b.cves:
3546- ... print c.displayname
3547+ ... print(c.displayname)
3548 CVE-1999-8979
3549
3550 Let's add the new CVE:
3551
3552=== modified file 'lib/lp/bugs/doc/displaying-bugs-and-tasks.txt'
3553--- lib/lp/bugs/doc/displaying-bugs-and-tasks.txt 2011-12-24 17:49:30 +0000
3554+++ lib/lp/bugs/doc/displaying-bugs-and-tasks.txt 2018-06-30 11:02:51 +0000
3555@@ -68,10 +68,10 @@
3556 >>> from lp.bugs.interfaces.bug import IBugSet
3557 >>> bug1 = getUtility(IBugSet).get(1)
3558 >>> upstream_task = bug1.bugtasks[0]
3559- >>> print upstream_task.product.name
3560+ >>> print(upstream_task.product.name)
3561 firefox
3562 >>> ubuntu_task = bug1.bugtasks[1]
3563- >>> print ubuntu_task.distribution.name
3564+ >>> print(ubuntu_task.distribution.name)
3565 ubuntu
3566
3567 So the logo for an upstream bug task shows the project icon:
3568
3569=== modified file 'lib/lp/bugs/doc/externalbugtracker-bug-imports.txt'
3570--- lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2016-01-26 15:47:37 +0000
3571+++ lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2018-06-30 11:02:51 +0000
3572@@ -37,7 +37,7 @@
3573 if they don't exist.
3574
3575 >>> from lp.registry.interfaces.person import IPersonSet
3576- >>> print getUtility(IPersonSet).getByEmail('joe.bloggs@example.com')
3577+ >>> print(getUtility(IPersonSet).getByEmail('joe.bloggs@example.com'))
3578 None
3579
3580 The method that imports a bug is importBug(). In addition to the
3581@@ -82,7 +82,7 @@
3582 >>> getUtility(IPersonSet).getByEmail(
3583 ... 'joe.bloggs@example.com', filter_status=False) is not None
3584 True
3585- >>> print bug.owner.displayname
3586+ >>> print(bug.owner.displayname)
3587 Joe Bloggs
3588
3589 Since they didn't have a Launchpad account before, they don't have a
3590@@ -94,9 +94,9 @@
3591 >>> reporter_email_addresses = getUtility(IEmailAddressSet).getByPerson(
3592 ... bug.owner)
3593 >>> for email_address in reporter_email_addresses:
3594- ... print "%s: %s" % (email_address.email, email_address.status.name)
3595+ ... print("%s: %s" % (email_address.email, email_address.status.name))
3596 joe.bloggs@example.com: NEW
3597- >>> print bug.owner.preferredemail
3598+ >>> print(bug.owner.preferredemail)
3599 None
3600
3601 >>> bug.owner.creation_rationale.name
3602@@ -136,7 +136,7 @@
3603 >>> external_bugtracker._bugs['5'] = {
3604 ... 'package': 'no-such-package',
3605 ... 'reporter': ("Joe Bloggs", "joe.bloggs@example.com")}
3606- >>> print debian.getSourcePackage('no-such-package')
3607+ >>> print(debian.getSourcePackage('no-such-package'))
3608 None
3609 >>> bug = bug_watch_updater.importBug(
3610 ... external_bugtracker, bugtracker, debian, '5')
3611@@ -146,7 +146,7 @@
3612 >>> [added_task] = bug.bugtasks
3613 >>> added_task.distribution.name
3614 u'debian'
3615- >>> print added_task.sourcepackagename
3616+ >>> print(added_task.sourcepackagename)
3617 None
3618
3619
3620@@ -160,7 +160,7 @@
3621
3622 >>> added_task.status.name
3623 'NEW'
3624- >>> print added_task.bugwatch.lastchecked
3625+ >>> print(added_task.bugwatch.lastchecked)
3626 None
3627
3628
3629
3630=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt'
3631--- lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2018-06-23 00:51:17 +0000
3632+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2018-06-30 11:02:51 +0000
3633@@ -146,10 +146,10 @@
3634
3635 >>> def print_bugs(bugs):
3636 ... for bug in sorted(bugs):
3637- ... print "Bug %s:" % bug
3638+ ... print("Bug %s:" % bug)
3639 ... for key in sorted(bugs[bug]):
3640- ... print " %s: %s" % (key, bugs[bug][key])
3641- ... print "\n"
3642+ ... print(" %s: %s" % (key, bugs[bug][key]))
3643+ ... print("\n")
3644
3645 >>> print_bugs(bugzilla._bugs)
3646 Bug 1:
3647@@ -242,7 +242,7 @@
3648 the alias and the bug's actual ID.
3649
3650 >>> for alias, bug_id in sorted(bugzilla._bug_aliases.items()):
3651- ... print "%s: %s" % (alias, bug_id)
3652+ ... print("%s: %s" % (alias, bug_id))
3653 bad-diodes: 3
3654 bug-three: 3
3655 bug-two: 2
3656@@ -274,7 +274,7 @@
3657 >>> no_alias_bugzilla.initializeRemoteBugDB([1])
3658 CALLED Bug.get({'ids': [1], 'permissive': True})
3659
3660- >>> print len(no_alias_bugzilla._bug_aliases)
3661+ >>> print(len(no_alias_bugzilla._bug_aliases))
3662 0
3663
3664
3665@@ -287,19 +287,19 @@
3666 >>> test_transport.print_method_calls = False
3667 >>> bugzilla.initializeRemoteBugDB([1, 2])
3668
3669- >>> print bugzilla.getRemoteStatus(1)
3670+ >>> print(bugzilla.getRemoteStatus(1))
3671 RESOLVED FIXED
3672
3673- >>> print bugzilla.getRemoteStatus(2)
3674+ >>> print(bugzilla.getRemoteStatus(2))
3675 NEW
3676
3677 Similarly, BugzillaAPI.getRemoteStatus() returns the remote priority and
3678 severity as a string.
3679
3680- >>> print bugzilla.getRemoteImportance(1)
3681+ >>> print(bugzilla.getRemoteImportance(1))
3682 P1 normal
3683
3684- >>> print bugzilla.getRemoteImportance(2)
3685+ >>> print(bugzilla.getRemoteImportance(2))
3686 P1 high
3687
3688 If a bug can't be found a BugNotFound error will be raised.
3689@@ -344,7 +344,7 @@
3690 CALLED Bug.search({'id': [1, 2],
3691 'last_change_time': <DateTime ...'20080611T09:00:00' at...>})
3692
3693- >>> print bug_ids
3694+ >>> print(bug_ids)
3695 ['2']
3696
3697 If we alter the changed_since date to move it back by a day, we'll get
3698@@ -355,7 +355,7 @@
3699 CALLED Bug.search({'id': [1, 2],
3700 'last_change_time': <DateTime ...'20080610T09:00:00' at...>})
3701
3702- >>> print bug_ids
3703+ >>> print(bug_ids)
3704 ['1', '2']
3705
3706 Bugzilla's Bug.search() method returns all the data for each bug it
3707@@ -363,10 +363,10 @@
3708 BugzillaAPI instance's bugs dict.
3709
3710 >>> for bug in sorted(bugzilla._bugs):
3711- ... print "Bug %s:" % bug
3712+ ... print("Bug %s:" % bug)
3713 ... for key in sorted(bugzilla._bugs[bug]):
3714- ... print " %s: %s" % (key, bugzilla._bugs[bug][key])
3715- ... print "\n"
3716+ ... print(" %s: %s" % (key, bugzilla._bugs[bug][key]))
3717+ ... print("\n")
3718 Bug 1:
3719 alias:
3720 assigned_to: test@canonical.com...
3721@@ -459,7 +459,7 @@
3722 >>> bug_comment_ids = bugzilla.getCommentIds(bug_watch.remotebug)
3723 CALLED Bug.comments({'ids': [1], 'include_fields': ['id']})
3724
3725- >>> print sorted(bug_comment_ids)
3726+ >>> print(sorted(bug_comment_ids))
3727 ['1', '3']
3728
3729 getCommentIds() can only be called if initializeRemoteBugDB() has been
3730@@ -489,10 +489,10 @@
3731
3732 >>> comments = bugzilla._bugs[1]['comments']
3733 >>> for comment_id in sorted(comments):
3734- ... print "Comment %s:" % comment_id
3735+ ... print("Comment %s:" % comment_id)
3736 ... comment = comments[comment_id]
3737 ... for key in sorted(comment):
3738- ... print " %s: %s" % (key, comment[key])
3739+ ... print(" %s: %s" % (key, comment[key]))
3740 Comment 1:
3741 author: trillian
3742 bug_id: 1
3743@@ -519,10 +519,10 @@
3744
3745 >>> comments = bugzilla._bugs[1]['comments']
3746 >>> for comment_id in sorted(comments):
3747- ... print "Comment %s:" % comment_id
3748+ ... print("Comment %s:" % comment_id)
3749 ... comment = comments[comment_id]
3750 ... for key in sorted(comment):
3751- ... print " %s: %s" % (key, comment[key])
3752+ ... print(" %s: %s" % (key, comment[key]))
3753 Comment 1:
3754 author: trillian
3755 bug_id: 1
3756@@ -543,7 +543,7 @@
3757
3758 >>> bugzilla.fetchComments(remote_bug, ['2', '4', '5', '6'])
3759 >>> displayname, email = bugzilla.getPosterForComment(remote_bug, '4')
3760- >>> print displayname, email
3761+ >>> print(displayname, email)
3762 Ford Prefect ford.prefect@h2g2.com
3763
3764 getPosterForComment() handles situations in which only an email address
3765@@ -552,7 +552,7 @@
3766 name will be generated for the user from their email address.
3767
3768 >>> displayname, email = bugzilla.getPosterForComment(remote_bug, '5')
3769- >>> print displayname, email
3770+ >>> print(displayname, email)
3771 None arthur.dent@earth.example.com
3772
3773 getPosterForComment() will also return displayname, email tuples in
3774@@ -561,14 +561,14 @@
3775 None.
3776
3777 >>> displayname, email = bugzilla.getPosterForComment(remote_bug, '2')
3778- >>> print displayname, email
3779+ >>> print(displayname, email)
3780 trillian None
3781
3782 Bugzilla 4.0 renamed the 'author' field to 'creator', but kept the old field
3783 for compatibility. Bugzilla 5.0 dropped the compatibility field.
3784
3785 >>> displayname, email = bugzilla.getPosterForComment(remote_bug, '6')
3786- >>> print displayname, email
3787+ >>> print(displayname, email)
3788 Slartibartfast slarti@magrathea.example.net
3789
3790
3791@@ -583,19 +583,19 @@
3792
3793 >>> message = bugzilla.getMessageForComment(
3794 ... bug_watch_two.remotebug, '2', sample_person)
3795- >>> print message.text_contents
3796+ >>> print(message.text_contents)
3797 Bring the passengers to the bridge please Marvin.
3798
3799- >>> print message.owner.displayname
3800+ >>> print(message.owner.displayname)
3801 Sample Person
3802
3803 The datecreated attribute of the Message will be the same as the 'time'
3804 field on the imported comment.
3805
3806- >>> print bugzilla._bugs[2]['comments'][2]['time']
3807+ >>> print(bugzilla._bugs[2]['comments'][2]['time'])
3808 2008-06-16 13:08:08
3809
3810- >>> print message.datecreated
3811+ >>> print(message.datecreated)
3812 2008-06-16 13:08:08+00:00
3813
3814
3815@@ -646,7 +646,7 @@
3816 The comment will be stored on the remote server with the other comments.
3817
3818 >>> bugzilla.xmlrpc_transport.print_method_calls = False
3819- >>> print sorted(bugzilla.getCommentIds(bug_watch.remotebug))
3820+ >>> print(sorted(bugzilla.getCommentIds(bug_watch.remotebug)))
3821 ['1', '3', '7']
3822
3823 >>> remote_bug = bug_watch.remotebug
3824@@ -655,7 +655,7 @@
3825 >>> bugzilla.fetchComments(remote_bug, ['7'])
3826 >>> message = bugzilla.getMessageForComment(
3827 ... bug_watch.remotebug, '7', sample_person)
3828- >>> print message.text_contents
3829+ >>> print(message.text_contents)
3830 This is a new remote comment.
3831 <BLANKLINE>
3832
3833
3834=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt'
3835--- lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2018-06-23 00:51:17 +0000
3836+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2018-06-30 11:02:51 +0000
3837@@ -123,7 +123,7 @@
3838 Successfully validated the token.
3839 CALLED Test.login_required()
3840
3841- >>> print return_value
3842+ >>> print(return_value)
3843 Wonderful, you've logged in! Aren't you a clever biped?
3844
3845 >>> test_transport.print_method_calls = False
3846@@ -199,10 +199,10 @@
3847
3848 >>> def print_bugs(bugs):
3849 ... for bug in sorted(bugs):
3850- ... print "Bug %s:" % bug
3851+ ... print("Bug %s:" % bug)
3852 ... for key in sorted(bugs[bug]):
3853- ... print " %s: %s" % (key, bugs[bug][key])
3854- ... print "\n"
3855+ ... print(" %s: %s" % (key, bugs[bug][key]))
3856+ ... print("\n")
3857
3858 >>> print_bugs(bugzilla._bugs)
3859 Bug 1:
3860@@ -265,7 +265,7 @@
3861 'ids': [1, 2],
3862 'permissive': True})
3863
3864- >>> print bug_ids
3865+ >>> print(bug_ids)
3866 [2]
3867
3868 If we alter the changed_since date to move it back by a day, we'll get
3869@@ -278,7 +278,7 @@
3870 'ids': [1, 2],
3871 'permissive': True})
3872
3873- >>> print bug_ids
3874+ >>> print(bug_ids)
3875 [1, 2]
3876
3877 Bugzilla's Launchpad.get_bugs() method returns all the data for each
3878@@ -286,10 +286,10 @@
3879 BugzillaLPPlugin instance's bugs dict.
3880
3881 >>> for bug in sorted(bugzilla._bugs):
3882- ... print "Bug %s:" % bug
3883+ ... print("Bug %s:" % bug)
3884 ... for key in sorted(bugzilla._bugs[bug]):
3885- ... print " %s: %s" % (key, bugzilla._bugs[bug][key])
3886- ... print "\n"
3887+ ... print(" %s: %s" % (key, bugzilla._bugs[bug][key]))
3888+ ... print("\n")
3889 Bug 1:
3890 alias:
3891 assigned_to: test@canonical.com...
3892@@ -373,7 +373,7 @@
3893 >>> bug_comment_ids = bugzilla.getCommentIds(remote_bug)
3894 CALLED Launchpad.comments({'bug_ids': [1], 'include_fields': ['id']})
3895
3896- >>> print sorted(bug_comment_ids)
3897+ >>> print(sorted(bug_comment_ids))
3898 ['1', '3']
3899
3900 getCommentIds() can only be called if initializeRemoteBugDB() has been
3901@@ -406,10 +406,10 @@
3902
3903 >>> comments = bugzilla._bugs[1]['comments']
3904 >>> for comment_id in sorted(comments):
3905- ... print "Comment %s:" % comment_id
3906+ ... print("Comment %s:" % comment_id)
3907 ... comment = comments[comment_id]
3908 ... for key in sorted(comment):
3909- ... print " %s: %s" % (key, comment[key])
3910+ ... print(" %s: %s" % (key, comment[key]))
3911 Comment 1:
3912 author: trillian
3913 id: 1
3914@@ -468,7 +468,7 @@
3915 >>> transaction.commit()
3916
3917 >>> bugzilla.xmlrpc_transport.print_method_calls = False
3918- >>> print sorted(bugzilla.getCommentIds(remote_bug))
3919+ >>> print(sorted(bugzilla.getCommentIds(remote_bug)))
3920 ['1', '3', '7']
3921
3922 >>> transaction.commit()
3923@@ -476,7 +476,7 @@
3924 >>> bugzilla.fetchComments(remote_bug, ['7'])
3925 >>> message = bugzilla.getMessageForComment(
3926 ... remote_bug, '7', sample_person)
3927- >>> print message.text_contents
3928+ >>> print(message.text_contents)
3929 This is a new remote comment.
3930 <BLANKLINE>
3931
3932@@ -501,7 +501,7 @@
3933 If there is no bug currently linked to the remote bug,
3934 getLaunchpadBugId() will return None.
3935
3936- >>> print launchpad_bug_id
3937+ >>> print(launchpad_bug_id)
3938 None
3939
3940 We'll set the launchpad_id for the remote bug so that we can retrieve
3941@@ -513,7 +513,7 @@
3942 set.
3943
3944 >>> launchpad_bug_id = bugzilla.getLaunchpadBugId(1)
3945- >>> print launchpad_bug_id
3946+ >>> print(launchpad_bug_id)
3947 42
3948
3949 setLaunchpadBugId() is used to set the Launchpad bug ID for a given
3950@@ -542,7 +542,7 @@
3951 CALLED Launchpad.get_bugs({'ids': [1], 'permissive': True})
3952
3953 >>> launchpad_bug_id = bugzilla.getLaunchpadBugId(1)
3954- >>> print launchpad_bug_id
3955+ >>> print(launchpad_bug_id)
3956 10
3957
3958
3959@@ -607,6 +607,6 @@
3960 CALLED Launchpad.get_bugs({'ids': [1, 2], 'permissive': True})
3961
3962 >>> for bug_id in sorted(product_mappings):
3963- ... print "%s: %s" % (bug_id, product_mappings[bug_id])
3964+ ... print("%s: %s" % (bug_id, product_mappings[bug_id]))
3965 1: Marvin
3966 2: HeartOfGold
3967
3968=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt'
3969--- lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt 2018-06-23 00:51:17 +0000
3970+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt 2018-06-30 11:02:51 +0000
3971@@ -26,8 +26,8 @@
3972 ... issuezilla._probe_version()
3973 (2, 11)
3974 >>> for bug_watch in mozilla_bugzilla.watches:
3975- ... print "%s: %s %s" % (bug_watch.remotebug,
3976- ... bug_watch.remotestatus, bug_watch.remote_importance)
3977+ ... print("%s: %s %s" % (bug_watch.remotebug,
3978+ ... bug_watch.remotestatus, bug_watch.remote_importance))
3979 2000:
3980 123543:
3981 42: FUBAR BAZBAZ
3982@@ -42,8 +42,8 @@
3983 (local bugs: 1, 2).
3984
3985 >>> for bug_watch in mozilla_bugzilla.watches:
3986- ... print "%s: %s %s" % (bug_watch.remotebug,
3987- ... bug_watch.remotestatus, bug_watch.remote_importance)
3988+ ... print("%s: %s %s" % (bug_watch.remotebug,
3989+ ... bug_watch.remotestatus, bug_watch.remote_importance))
3990 2000: RESOLVED FIXED LOW
3991 123543: ASSIGNED HIGH
3992 42: FUBAR BAZBAZ
3993@@ -80,10 +80,10 @@
3994 >>> with old_bugzilla.responses():
3995 ... old_bugzilla.initializeRemoteBugDB(remote_bugs)
3996 >>> for remote_bug in remote_bugs:
3997- ... print "%s: %s %s" % (
3998+ ... print("%s: %s %s" % (
3999 ... remote_bug,
4000 ... old_bugzilla.getRemoteStatus(remote_bug),
4001- ... old_bugzilla.getRemoteImportance(remote_bug))
4002+ ... old_bugzilla.getRemoteImportance(remote_bug)))
4003 42: RESOLVED FIXED LOW BLOCKER
4004 123543: ASSIGNED HIGH BLOCKER
4005
4006@@ -104,8 +104,8 @@
4007 a) The bug status tag is <bz:status> and not <bz:bug_status>
4008
4009 >>> bug_item_file = weird_bugzilla._readBugItemFile()
4010- >>> "<bz:status>" in bug_item_file
4011- True
4012+ >>> print(bug_item_file)
4013+ <li>...<bz:status>...
4014
4015 b) The content is non-ascii:
4016
4017@@ -120,10 +120,10 @@
4018 >>> with weird_bugzilla.responses():
4019 ... weird_bugzilla.initializeRemoteBugDB(remote_bugs)
4020 >>> for remote_bug in remote_bugs:
4021- ... print "%s: %s %s" % (
4022+ ... print("%s: %s %s" % (
4023 ... remote_bug,
4024 ... weird_bugzilla.getRemoteStatus(remote_bug),
4025- ... weird_bugzilla.getRemoteImportance(remote_bug))
4026+ ... weird_bugzilla.getRemoteImportance(remote_bug)))
4027 2000: ASSIGNED HIGH BLOCKER
4028 123543: RESOLVED FIXED HIGH BLOCKER
4029
4030
4031=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla.txt'
4032--- lib/lp/bugs/doc/externalbugtracker-bugzilla.txt 2018-06-23 00:51:17 +0000
4033+++ lib/lp/bugs/doc/externalbugtracker-bugzilla.txt 2018-06-30 11:02:51 +0000
4034@@ -30,29 +30,29 @@
4035 Traceback (most recent call last):
4036 ...
4037 UnparsableBugTrackerVersion:
4038- Failed to parse version 'A.B' for http://...
4039+ Failed to parse version u'A.B' for http://...
4040
4041 The version parsing is carried out by the Bugzilla._parseVersion()
4042 method, which takes a version string and returns a tuple of
4043 (major_version, minor_version).
4044
4045 >>> external_bugzilla = Bugzilla('http://example.com')
4046- >>> print external_bugzilla._parseVersion('3.2')
4047+ >>> print(external_bugzilla._parseVersion('3.2'))
4048 (3, 2)
4049
4050 It can handle version strings with an -$foo suffix.
4051
4052- >>> print external_bugzilla._parseVersion('3.2-foobar')
4053+ >>> print(external_bugzilla._parseVersion('3.2-foobar'))
4054 (3, 2)
4055
4056 And will also handle versions which contain the string 'rc'.
4057
4058- >>> print external_bugzilla._parseVersion('3.2rc')
4059+ >>> print(external_bugzilla._parseVersion('3.2rc'))
4060 (3, 2)
4061
4062 + characters in the version string will be removed.
4063
4064- >>> print external_bugzilla._parseVersion('3.2+1')
4065+ >>> print(external_bugzilla._parseVersion('3.2+1'))
4066 (3, 2, 1)
4067
4068 Since we don't want to depend on a working network connection, we use a
4069@@ -456,9 +456,9 @@
4070 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
4071 >>> bug_watch_updater = CheckwatchesMaster(txn, logger=FakeLogger())
4072 >>> for bug_watch in gnome_bugzilla.watches:
4073- ... print "%s: %s %s" % (bug_watch.remotebug,
4074+ ... print("%s: %s %s" % (bug_watch.remotebug,
4075 ... bug_watch.remotestatus,
4076- ... bug_watch.remote_importance)
4077+ ... bug_watch.remote_importance))
4078 304070: None None
4079 3224: None
4080 >>> with external_bugzilla.responses():
4081@@ -469,9 +469,9 @@
4082 http://bugzilla.gnome.org/bugs (local bugs: 15).
4083
4084 >>> for bug_watch in gnome_bugzilla.watches:
4085- ... print "%s: %s %s" % (bug_watch.remotebug,
4086+ ... print("%s: %s %s" % (bug_watch.remotebug,
4087 ... bug_watch.remotestatus,
4088- ... bug_watch.remote_importance)
4089+ ... bug_watch.remote_importance))
4090 304070: None None
4091 3224: RESOLVED FIXED MINOR URGENT
4092
4093@@ -606,7 +606,7 @@
4094
4095 >>> bug_nine = getUtility(IBugSet).get(9)
4096 >>> thunderbird_task = bug_nine.bugtasks[0]
4097- >>> print thunderbird_task.status.title
4098+ >>> print(thunderbird_task.status.title)
4099 Unknown
4100 >>> thunderbird_task.bugwatch.remotestatus is None
4101 True
4102@@ -639,13 +639,13 @@
4103
4104 >>> bug_nine = getUtility(IBugSet).get(9)
4105 >>> thunderbird_task = bug_nine.bugtasks[0]
4106- >>> print thunderbird_task.status.title
4107+ >>> print(thunderbird_task.status.title)
4108 In Progress
4109- >>> print thunderbird_task.importance.title
4110+ >>> print(thunderbird_task.importance.title)
4111 Wishlist
4112- >>> print thunderbird_task.bugwatch.remotestatus
4113+ >>> print(thunderbird_task.bugwatch.remotestatus)
4114 ASSIGNED
4115- >>> print thunderbird_task.bugwatch.remote_importance
4116+ >>> print(thunderbird_task.bugwatch.remote_importance)
4117 MEDIUM ENHANCEMENT
4118
4119 If we change the bugtask status, it will be updated again even though
4120@@ -663,13 +663,13 @@
4121
4122 >>> bug_nine = getUtility(IBugSet).get(9)
4123 >>> thunderbird_task = bug_nine.bugtasks[0]
4124- >>> print thunderbird_task.status.title
4125+ >>> print(thunderbird_task.status.title)
4126 In Progress
4127- >>> print thunderbird_task.importance.title
4128+ >>> print(thunderbird_task.importance.title)
4129 Wishlist
4130- >>> print thunderbird_task.bugwatch.remotestatus
4131+ >>> print(thunderbird_task.bugwatch.remotestatus)
4132 ASSIGNED
4133- >>> print thunderbird_task.bugwatch.remote_importance
4134+ >>> print(thunderbird_task.bugwatch.remote_importance)
4135 MEDIUM ENHANCEMENT
4136
4137 If there are two bug watches, linked to different bugs, pointing to the
4138@@ -692,14 +692,14 @@
4139 INFO Updating 2 watches for 1 bugs on https://bugzilla.mozilla.org
4140
4141 >>> bug_watch1 = getUtility(IBugWatchSet).get(bug_watch1_id)
4142- >>> print bug_watch1.remotestatus
4143+ >>> print(bug_watch1.remotestatus)
4144 RESOLVED FIXED
4145- >>> print bug_watch1.remote_importance
4146+ >>> print(bug_watch1.remote_importance)
4147 LOW BLOCKER
4148 >>> bug_watch2 = getUtility(IBugWatchSet).get(bug_watch2_id)
4149- >>> print bug_watch2.remotestatus
4150+ >>> print(bug_watch2.remotestatus)
4151 RESOLVED FIXED
4152- >>> print bug_watch2.remote_importance
4153+ >>> print(bug_watch2.remote_importance)
4154 LOW BLOCKER
4155
4156 If updateBugWatches() can't parse the XML file returned from the remote
4157@@ -757,7 +757,7 @@
4158 >>> external_bugzilla.bug_item_file = 'gnome_bug_li_item_noproduct.xml'
4159 >>> with external_bugzilla.responses():
4160 ... external_bugzilla.initializeRemoteBugDB(['84'])
4161- >>> print external_bugzilla.getRemoteProduct('84')
4162+ >>> print(external_bugzilla.getRemoteProduct('84'))
4163 None
4164
4165 Requesting the product for a bug that doesn't exist raises BugNotFound.
4166
4167=== modified file 'lib/lp/bugs/doc/externalbugtracker-checkwatches.txt'
4168--- lib/lp/bugs/doc/externalbugtracker-checkwatches.txt 2011-12-28 17:03:06 +0000
4169+++ lib/lp/bugs/doc/externalbugtracker-checkwatches.txt 2018-06-30 11:02:51 +0000
4170@@ -45,8 +45,8 @@
4171 ... external_bugtracker = get_external_bugtracker(bugtracker)
4172 ... finally:
4173 ... log.setLevel(log.level - 100)
4174- ... print "%s --> %s" % (bugtracker_type.title,
4175- ... external_bugtracker)
4176+ ... print("%s --> %s" % (bugtracker_type.title,
4177+ ... external_bugtracker))
4178 Bugzilla --> <lp.bugs...bugzilla.Bugzilla ...>
4179 Debbugs --> <lp.bugs...debbugs.DebBugs ...>
4180 Mantis --> <lp.bugs...mantis.Mantis object at ...>
4181
4182=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-imports.txt'
4183--- lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2015-07-21 09:04:01 +0000
4184+++ lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2018-06-30 11:02:51 +0000
4185@@ -103,10 +103,10 @@
4186 ... for message in bug.messages[1:]:
4187 ... bug_message = getUtility(IBugMessageSet).getByBugAndMessage(
4188 ... bug, message)
4189- ... print bug_message.bugwatch == bug_watch
4190- ... print "%s: %s" % (
4191+ ... print(bug_message.bugwatch == bug_watch)
4192+ ... print("%s: %s" % (
4193 ... bug_message.remote_comment_id,
4194- ... bug_message.message.text_contents)
4195+ ... bug_message.message.text_contents))
4196 >>> print_bug_messages(bug, bug_watch)
4197 True
4198 1: Example comment the first
4199@@ -153,11 +153,11 @@
4200
4201 >>> joe.displayname
4202 u'Joe Bloggs'
4203- >>> print joe.preferredemail
4204+ >>> print(joe.preferredemail)
4205 None
4206- >>> print joe.creation_rationale.name
4207+ >>> print(joe.creation_rationale.name)
4208 BUGIMPORT
4209- >>> print joe.creation_comment
4210+ >>> print(joe.creation_comment)
4211 when importing comments for Bugzilla *TESTING* #123456.
4212
4213 If the poster's email is already registered in Launchpad, the comment
4214@@ -198,7 +198,7 @@
4215 >>> bug.messages[-1].owner.name
4216 u'noemail-bugzilla-checkwatches-1'
4217
4218- >>> print bug.messages[-1].owner.preferredemail
4219+ >>> print(bug.messages[-1].owner.preferredemail)
4220 None
4221
4222 A BugTrackerPerson record will have been created to map the new Person
4223@@ -222,7 +222,7 @@
4224 or display name found. (OOPS-...)
4225 INFO Imported 0 comments for remote bug 123456 on ...
4226
4227- >>> print bug.messages[-1].text_contents
4228+ >>> print(bug.messages[-1].text_contents)
4229 Yet another comment.
4230
4231 Let's delete that comment now so that it doesn't break later tests.
4232@@ -302,7 +302,7 @@
4233 ... content='Pushable comment', bugwatch=bug_watch2)
4234
4235 >>> for bug_message in bug_watch2.getImportedBugMessages():
4236- ... print bug_message.message.text_contents
4237+ ... print(bug_message.message.text_contents)
4238 Imported comment
4239
4240 >>> transaction.commit()
4241@@ -359,7 +359,7 @@
4242 >>> bug_message_two = getUtility(IBugMessageSet).getByBugAndMessage(
4243 ... bug, message_two)
4244
4245- >>> print bug_message_one.bugwatch
4246+ >>> print(bug_message_one.bugwatch)
4247 None
4248
4249 >>> bug_message_two.bugwatch == bug_watch
4250@@ -394,7 +394,7 @@
4251 INFO Imported 1 comments for remote bug 123456...
4252
4253 >>> for cve in bug_watch.bug.cves:
4254- ... print cve.displayname
4255+ ... print(cve.displayname)
4256 CVE-1991-9911
4257
4258 Karma is only awarded for actions that occur within Launchpad. If an
4259@@ -416,7 +416,7 @@
4260 INFO Imported 1 comments for remote bug 123456...
4261
4262 >>> for cve in sorted([cve.displayname for cve in bug_watch.bug.cves]):
4263- ... print cve
4264+ ... print(cve)
4265 CVE-1991-9911
4266 CVE-1999-0593
4267
4268@@ -478,7 +478,7 @@
4269 >>> notifications[0].message.owner.name
4270 u'bug-watch-updater'
4271
4272- >>> print notifications[0].message.text_contents
4273+ >>> print(notifications[0].message.text_contents)
4274 Launchpad has imported 2 comments from the remote bug at
4275 http://.../show_bug.cgi?id=42.
4276 <BLANKLINE>
4277@@ -526,8 +526,8 @@
4278 >>> len(notifications)
4279 2
4280 >>> for notification in notifications:
4281- ... print "%s wrote: %s" % (
4282+ ... print("%s wrote: %s" % (
4283 ... notification.message.owner.name,
4284- ... notification.message.text_contents)
4285+ ... notification.message.text_contents))
4286 joe-bloggs wrote: Third imported comment (initial import)
4287 joe-bloggs wrote: Fourth imported comment (initial import)
4288
4289=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt'
4290--- lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2015-07-08 16:05:11 +0000
4291+++ lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2018-06-30 11:02:51 +0000
4292@@ -58,8 +58,8 @@
4293 ... remote_comment_id = str(self.next_comment_id)
4294 ... self.remote_comments[remote_comment_id] = comment_body
4295 ...
4296- ... print "Comment added as remote comment %s" % (
4297- ... remote_comment_id)
4298+ ... print("Comment added as remote comment %s" % (
4299+ ... remote_comment_id))
4300 ...
4301 ... self.next_comment_id += 1
4302 ... return remote_comment_id
4303@@ -74,7 +74,7 @@
4304 remote_comment_id set. This is because it originated in Launchpad and
4305 has not yet been pushed to the remote bugtracker.
4306
4307- >>> print bug_message.remote_comment_id is None
4308+ >>> print(bug_message.remote_comment_id is None)
4309 True
4310
4311 The IBugWatch interface defines a property, unpushed_comments, which
4312@@ -84,7 +84,7 @@
4313 >>> comments = [
4314 ... comment.message.text_contents
4315 ... for comment in bug_watch.unpushed_comments]
4316- >>> print comments
4317+ >>> print(comments)
4318 [u'Pushing, for the purpose of.']
4319
4320 The CheckwatchesMaster method pushBugComments() is responsible for
4321@@ -112,9 +112,9 @@
4322 ... for message in bug.messages[1:]:
4323 ... bug_message = getUtility(IBugMessageSet).getByBugAndMessage(
4324 ... bug, message)
4325- ... print "%s: %s" % (
4326+ ... print("%s: %s" % (
4327 ... bug_message.remote_comment_id,
4328- ... bug_message.message.text_contents)
4329+ ... bug_message.message.text_contents))
4330 >>> print_bug_messages(bug, bug_watch)
4331 1: Pushing, for the purpose of.
4332
4333@@ -129,7 +129,7 @@
4334 If we now check the bug watch's unpushed_comments property, we will
4335 find it to be empty.
4336
4337- >>> print list(bug_watch.unpushed_comments)
4338+ >>> print(list(bug_watch.unpushed_comments))
4339 []
4340
4341 If more comments are added to the bug they will be pushed to the remote
4342@@ -242,7 +242,7 @@
4343
4344 >>> class ErroringExternalBugTracker(CommentPushingExternalBugTracker):
4345 ... def addRemoteComment(self, remote_bug, comment_body, rfc822msgid):
4346- ... print "Pretending to add a comment to bug %s" % remote_bug
4347+ ... print("Pretending to add a comment to bug %s" % remote_bug)
4348 ... return None
4349
4350 >>> with lp_dbuser():
4351@@ -273,8 +273,8 @@
4352
4353 >>> remote_comments = external_bugtracker.remote_comments
4354 >>> for remote_comment_id in sorted(remote_comments.keys()):
4355- ... print remote_comments[remote_comment_id]
4356- ... print "--------------------"
4357+ ... print(remote_comments[remote_comment_id])
4358+ ... print("--------------------")
4359 Sample Person added the following comment to Launchpad bug report...:
4360 <BLANKLINE>
4361 Pushing, for the purpose of.
4362@@ -306,7 +306,7 @@
4363 the comment author, with the pushed comment.
4364
4365 >>> formatted_message = bugwatch_updater._formatRemoteComment(message)
4366- >>> print formatted_message
4367+ >>> print(formatted_message)
4368 Sample Person added the following comment to Launchpad bug report...:
4369 <BLANKLINE>
4370 Pushing, for the purpose of.
4371@@ -327,7 +327,7 @@
4372
4373 >>> bugwatch_updater.external_bugtracker = external_bugtracker
4374 >>> formatted_message = bugwatch_updater._formatRemoteComment(message)
4375- >>> print formatted_message
4376+ >>> print(formatted_message)
4377 Egg and bacon
4378 Egg, sausage and bacon
4379 Egg, bacon and bug #...
4380
4381=== modified file 'lib/lp/bugs/doc/externalbugtracker-debbugs.txt'
4382--- lib/lp/bugs/doc/externalbugtracker-debbugs.txt 2015-09-08 09:09:28 +0000
4383+++ lib/lp/bugs/doc/externalbugtracker-debbugs.txt 2018-06-30 11:02:51 +0000
4384@@ -131,7 +131,7 @@
4385 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
4386 >>> for bug_watch_id in bug_watch_ids:
4387 ... bug_watch = getUtility(IBugWatchSet).get(bug_watch_id)
4388- ... print "%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus)
4389+ ... print("%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus))
4390 280883: done grave woody security
4391 304014: open important
4392 327452: done critical patch security
4393@@ -153,8 +153,9 @@
4394 >>> for bug_watch in bug_watches:
4395 ... bugtasks += list(bug_watch.bugtasks)
4396 >>> for bugtask in sorted(bugtasks, key=operator.attrgetter('id')):
4397- ... print bugtask.bug.id, bugtask.bugtargetname, bugtask.status.title,
4398- ... print bugtask.importance.title
4399+ ... print(bugtask.bug.id, bugtask.bugtargetname, bugtask.status.title,
4400+ ... end=' ')
4401+ ... print(bugtask.importance.title)
4402 1 mozilla-firefox (Debian) New Unknown
4403 3 mozilla-firefox (Debian Sarge) New Unknown
4404 7 evolution (Debian) Fix Released Unknown
4405@@ -185,13 +186,13 @@
4406 the bug has been fixed and a new package with the fix has been
4407 uploaded, so it maps to 'Fix Released.
4408
4409- >>> print external_debbugs.convertRemoteStatus('done normal').title
4410+ >>> print(external_debbugs.convertRemoteStatus('done normal').title)
4411 Fix Released
4412
4413 If the status is simply 'open', we map it to 'New', since
4414 there's no way of knowing if the bug is confirmed or not.
4415
4416- >>> print external_debbugs.convertRemoteStatus('open normal').title
4417+ >>> print(external_debbugs.convertRemoteStatus('open normal').title)
4418 New
4419
4420 If the 'wontfix' tag is present we map it to "Won't Fix". The 'wontfix'
4421@@ -203,34 +204,34 @@
4422 combination of 'fixed' & 'wontfix' tags will only affect the malone status
4423 temporarily.
4424
4425- >>> print external_debbugs.convertRemoteStatus(
4426+ >>> print(external_debbugs.convertRemoteStatus(
4427 ... 'open normal pending fixed fixed-in-experimental'
4428- ... ' wontfix help confirmed upstream fixed-upstream').title
4429+ ... ' wontfix help confirmed upstream fixed-upstream').title)
4430 Won't Fix
4431
4432 If the 'moreinfo' tag is present, we map the status to 'Needs Info'.
4433
4434- >>> print external_debbugs.convertRemoteStatus(
4435- ... 'open normal moreinfo').title
4436+ >>> print(external_debbugs.convertRemoteStatus(
4437+ ... 'open normal moreinfo').title)
4438 Incomplete
4439
4440 Of course, if the 'moreinfo' tag is present and the status is 'done',
4441 we still map to 'Fix Released'.
4442
4443- >>> print external_debbugs.convertRemoteStatus(
4444- ... 'done normal moreinfo').title
4445+ >>> print(external_debbugs.convertRemoteStatus(
4446+ ... 'done normal moreinfo').title)
4447 Fix Released
4448
4449 If the 'help' tag is present, it means that the maintainer is
4450 requesting help with the bug, so it's most likely a confirmed bug.
4451
4452- >>> print external_debbugs.convertRemoteStatus('open normal help').title
4453+ >>> print(external_debbugs.convertRemoteStatus('open normal help').title)
4454 Confirmed
4455
4456 The 'pending' tag means that a fix is about to be uploaded, so it maps
4457 to 'Fix Committed'.
4458
4459- >>> print (
4460+ >>> print(
4461 ... external_debbugs.convertRemoteStatus('open normal pending').title)
4462 Fix Committed
4463
4464@@ -238,46 +239,46 @@
4465 somehow, but there's still an issue to be solved. We map it to 'Fix
4466 Committed', so that people can see that a fix is available.
4467
4468- >>> print external_debbugs.convertRemoteStatus('open normal fixed').title
4469+ >>> print(external_debbugs.convertRemoteStatus('open normal fixed').title)
4470 Fix Committed
4471
4472 If the bug is forwarded upstream, it should mean that it's a confirmed
4473 bug.
4474
4475- >>> print external_debbugs.convertRemoteStatus(
4476- ... 'open normal upstream').title
4477+ >>> print(external_debbugs.convertRemoteStatus(
4478+ ... 'open normal upstream').title)
4479 Confirmed
4480
4481 And of course, if the maintainer marked the bug as 'confirmed'.
4482
4483- >>> print external_debbugs.convertRemoteStatus(
4484- ... 'open normal confirmed').title
4485+ >>> print(external_debbugs.convertRemoteStatus(
4486+ ... 'open normal confirmed').title)
4487 Confirmed
4488
4489
4490 If it has been fixed upstream, it's definitely a confirmed bug.
4491
4492- >>> print external_debbugs.convertRemoteStatus(
4493- ... 'open normal fixed-upstream').title
4494+ >>> print(external_debbugs.convertRemoteStatus(
4495+ ... 'open normal fixed-upstream').title)
4496 Confirmed
4497
4498 If it has been fixed in experimental, we mark it 'Fix Committed' until
4499 the fix has reached the unstable distribution.
4500
4501- >>> print external_debbugs.convertRemoteStatus(
4502- ... 'open normal fixed-in-experimental').title
4503+ >>> print(external_debbugs.convertRemoteStatus(
4504+ ... 'open normal fixed-in-experimental').title)
4505 Fix Committed
4506
4507 All other tags we map to 'New'.
4508
4509- >>> print external_debbugs.convertRemoteStatus(
4510- ... 'open normal unreproducible lfs woody').title
4511+ >>> print(external_debbugs.convertRemoteStatus(
4512+ ... 'open normal unreproducible lfs woody').title)
4513 New
4514
4515 If we pass in a malformed status string an UnknownRemoteStatusError will
4516 be raised.
4517
4518- >>> print external_debbugs.convertRemoteStatus('open')
4519+ >>> print(external_debbugs.convertRemoteStatus('open'))
4520 Traceback (most recent call last):
4521 ...
4522 UnknownRemoteStatusError: open
4523@@ -299,23 +300,23 @@
4524 >>> report = email.message_from_file(
4525 ... open(os.path.join(
4526 ... test_db_location, 'db-h', '35', '322535.report')))
4527- >>> print report['From']
4528+ >>> print(report['From'])
4529 Moritz Muehlenhoff <jmm@inutil.org>
4530
4531 >>> name, email = external_debbugs.getBugReporter('322535')
4532- >>> print name
4533+ >>> print(name)
4534 Moritz Muehlenhoff
4535- >>> print email
4536+ >>> print(email)
4537 jmm@inutil.org
4538
4539 The getBugSummaryAndDescription method reads the bug report from the
4540 debbugs db, and returns the debbugs subject as the summary, and the
4541 description as the description.
4542
4543- >>> print report['Subject']
4544+ >>> print(report['Subject'])
4545 evolution: Multiple format string vulnerabilities in Evolution
4546
4547- >>> print report.get_payload(decode=True)
4548+ >>> print(report.get_payload(decode=True))
4549 Package: evolution
4550 Severity: grave
4551 Tags: security
4552@@ -328,10 +329,10 @@
4553
4554 >>> summary, description = external_debbugs.getBugSummaryAndDescription(
4555 ... '322535')
4556- >>> print summary
4557+ >>> print(summary)
4558 evolution: Multiple format string vulnerabilities in Evolution
4559
4560- >>> print description
4561+ >>> print(description)
4562 Package: evolution
4563 Severity: grave
4564 Tags: security
4565@@ -345,7 +346,7 @@
4566 Which package to file the bug against is determined by the
4567 getBugTargetName() method.
4568
4569- >>> print external_debbugs.getBugTargetName('322535')
4570+ >>> print(external_debbugs.getBugTargetName('322535'))
4571 evolution
4572
4573
4574@@ -390,7 +391,7 @@
4575 bug. DebBugs comment IDs are RFC822 message IDs.
4576
4577 >>> comment_ids = external_debbugs.getCommentIds(bug_watch.remotebug)
4578- >>> print comment_ids
4579+ >>> print(comment_ids)
4580 ['<20040309081430.98BF411EE67@tux>']
4581
4582 However, it will only return IDs for comments which can actually be
4583@@ -400,7 +401,7 @@
4584 ... 'debbugs-comment-with-no-date.txt')
4585
4586 >>> comment_ids = external_debbugs.getCommentIds(bug_watch.remotebug)
4587- >>> print comment_ids
4588+ >>> print(comment_ids)
4589 []
4590
4591 getCommentIds() will only return a given comment ID once, even if that
4592@@ -418,14 +419,14 @@
4593 >>> debian_bug = external_debbugs._findBug(bug_watch.remotebug)
4594 >>> for comment in debian_bug.comments:
4595 ... comment_email = email.message_from_string(comment)
4596- ... print comment_email['message-id']
4597+ ... print(comment_email['message-id'])
4598 <20040309081430.98BF411EE67@tux>
4599 <20040309081430.98BF411EE67@tux>
4600
4601 However, getCommentIds() will only return the comment ID once.
4602
4603 >>> comment_ids = external_debbugs.getCommentIds(bug_watch.remotebug)
4604- >>> print comment_ids
4605+ >>> print(comment_ids)
4606 ['<20040309081430.98BF411EE67@tux>']
4607
4608 The debbugs implementation of fetchComments() doesn't actually do
4609@@ -441,7 +442,7 @@
4610 >>> comment_id = comment_ids[0]
4611 >>> poster_name, poster_email = external_debbugs.getPosterForComment(
4612 ... bug_watch.remotebug, comment_id)
4613- >>> print "%s <%s>" % (poster_name, poster_email)
4614+ >>> print("%s <%s>" % (poster_name, poster_email))
4615 Teun Vink <teun@tux.office.luna.net>
4616
4617 getMessageForComment() will return an imported comment as a Launchpad
4618@@ -459,10 +460,10 @@
4619 >>> message = external_debbugs.getMessageForComment(
4620 ... bug_watch.remotebug, comment_id, poster)
4621
4622- >>> print message.owner.displayname
4623+ >>> print(message.owner.displayname)
4624 Teun Vink
4625
4626- >>> print message.text_contents
4627+ >>> print(message.text_contents)
4628 Things happen.
4629
4630 Where the DebBugs comment specifies a date in its Received header,
4631@@ -476,14 +477,14 @@
4632 ... 'debbugs-comment-with-received-date.txt')
4633
4634 >>> comment_ids = external_debbugs.getCommentIds(bug_watch.remotebug)
4635- >>> print comment_ids
4636+ >>> print(comment_ids)
4637 ['<yetanothermessageid@launchpad>']
4638
4639 >>> external_debbugs.fetchComments(bug_watch, comment_ids)
4640 >>> message = external_debbugs.getMessageForComment(
4641 ... bug_watch.remotebug, comment_ids[0], poster)
4642
4643- >>> print message.datecreated
4644+ >>> print(message.datecreated)
4645 2008-05-30 21:18:12+00:00
4646
4647 If we parse the comment manually we'll see that the message's
4648@@ -494,10 +495,10 @@
4649 >>> parsed_message = email.message_from_string(
4650 ... read_test_file('debbugs-comment-with-received-date.txt'))
4651
4652- >>> print parsed_message['date']
4653+ >>> print(parsed_message['date'])
4654 Fri, 14 Dec 2007 18:54:30 +0000
4655
4656- >>> print parsed_message['received']
4657+ >>> print(parsed_message['received'])
4658 (at 220301) by example.com; 30 May 2008 21:18:12 +0000
4659
4660 However, if none of the Received headers don't match the hostname that
4661@@ -513,16 +514,16 @@
4662 >>> message = external_debbugs.getMessageForComment(
4663 ... bug_watch.remotebug, comment_ids[0], poster)
4664
4665- >>> print message.datecreated
4666+ >>> print(message.datecreated)
4667 2007-12-14 18:54:30+00:00
4668
4669 >>> parsed_message = email.message_from_string(
4670 ... read_test_file('debbugs-comment-with-received-date.txt'))
4671
4672- >>> print parsed_message['date']
4673+ >>> print(parsed_message['date'])
4674 Fri, 14 Dec 2007 18:54:30 +0000
4675
4676- >>> print parsed_message['received']
4677+ >>> print(parsed_message['received'])
4678 (at 220301) by example.com; 30 May 2008 21:18:12 +0000
4679
4680 DebBugs has a method, _getDateForComment(), which returns the correct
4681@@ -535,7 +536,7 @@
4682 If the message has no Date or useful Received headers,
4683 _getDateForComment() will return None.
4684
4685- >>> print external_debbugs._getDateForComment(test_message)
4686+ >>> print(external_debbugs._getDateForComment(test_message))
4687 None
4688
4689 If the message has only a Date header, that will be returned as the
4690@@ -591,19 +592,19 @@
4691
4692 >>> transaction.commit()
4693
4694- >>> external_debbugs.addRemoteComment(
4695+ >>> print(external_debbugs.addRemoteComment(
4696 ... '1234', 'A little fermented curd will do the trick!',
4697- ... '<123456@launchpad.net>')
4698- '<123456@launchpad.net>'
4699+ ... '<123456@launchpad.net>'))
4700+ <123456@launchpad.net>
4701
4702 We can look for the mail that would have been sent.
4703
4704 >>> from lp.testing.mail_helpers import pop_notifications
4705 >>> [msg] = pop_notifications()
4706- >>> print msg['X-Envelope-To']
4707+ >>> print(msg['X-Envelope-To'])
4708 1234@example.com
4709
4710- >>> print str(msg)
4711+ >>> print(str(msg))
4712 From ...
4713 Content-Type...
4714 Message-Id: <123456@launchpad.net>
4715@@ -648,7 +649,7 @@
4716 >>> (out, err) = process.communicate()
4717 >>> process.returncode
4718 0
4719- >>> print err
4720+ >>> print(err)
4721 INFO Updating 1 watches for 1 bugs on http://bugs.debian.org
4722 INFO Imported 4 comments for remote bug 237001...
4723 INFO Imported debbugs #237001 as Launchpad bug #...
4724@@ -670,7 +671,7 @@
4725
4726 >>> [imported_bug] = debbugs.getBugsWatching('237001')
4727 >>> for bugtask in imported_bug.bugtasks:
4728- ... print "%s: %s" % (bugtask.bugtargetname, bugtask.status.name)
4729+ ... print("%s: %s" % (bugtask.bugtargetname, bugtask.status.name))
4730 evolution (Ubuntu): NEW
4731 evolution (Debian): NEW
4732
4733@@ -704,13 +705,13 @@
4734 >>> external_debbugs = DebBugs(
4735 ... 'http://example.com/', db_location=test_db_location)
4736
4737- >>> print external_debbugs.getRemoteProduct('237001')
4738+ >>> print(external_debbugs.getRemoteProduct('237001'))
4739 evolution
4740
4741 Trying to call getRemoteProduct() on a bug that doesn't exist will raise
4742 a BugNotFound error.
4743
4744- >>> print external_debbugs.getRemoteProduct('42')
4745+ >>> print(external_debbugs.getRemoteProduct('42'))
4746 Traceback (most recent call last):
4747 ...
4748 BugNotFound: 42
4749
4750=== modified file 'lib/lp/bugs/doc/externalbugtracker-emailaddress.txt'
4751--- lib/lp/bugs/doc/externalbugtracker-emailaddress.txt 2015-03-13 19:05:50 +0000
4752+++ lib/lp/bugs/doc/externalbugtracker-emailaddress.txt 2018-06-30 11:02:51 +0000
4753@@ -114,9 +114,9 @@
4754 Similarly, Bug.getBugWatch() will always return None for email address
4755 bug trackers.
4756
4757- >>> print example_bug.getBugWatch(email_tracker, '')
4758+ >>> print(example_bug.getBugWatch(email_tracker, ''))
4759 None
4760
4761- >>> print example_bug.getBugWatch(email_tracker, message_id)
4762+ >>> print(example_bug.getBugWatch(email_tracker, message_id))
4763 None
4764
4765
4766=== modified file 'lib/lp/bugs/doc/externalbugtracker-linking-back.txt'
4767--- lib/lp/bugs/doc/externalbugtracker-linking-back.txt 2015-07-08 16:05:11 +0000
4768+++ lib/lp/bugs/doc/externalbugtracker-linking-back.txt 2018-06-30 11:02:51 +0000
4769@@ -19,13 +19,13 @@
4770 ... self.last_launchpad_bug_id = None
4771 ...
4772 ... def getLaunchpadBugId(self, remote_bug):
4773- ... print "Getting Launchpad id for bug %s" % remote_bug
4774+ ... print("Getting Launchpad id for bug %s" % remote_bug)
4775 ... return self.last_launchpad_bug_id
4776 ...
4777 ... def setLaunchpadBugId(self, remote_bug, launchpad_bug_id,
4778 ... launchpad_bug_url):
4779 ... self.last_launchpad_bug_id = launchpad_bug_id
4780- ... print "Setting Launchpad id for bug %s" % remote_bug
4781+ ... print("Setting Launchpad id for bug %s" % remote_bug)
4782
4783 The methods are called by the CheckwatchesMaster class:
4784
4785@@ -111,8 +111,8 @@
4786
4787 unlinked_bug doesn't link to bug 42 on the remote bug tracker.
4788
4789- >>> print unlinked_bug.getBugWatch(
4790- ... bug_watch.bugtracker, bug_watch.remotebug)
4791+ >>> print(unlinked_bug.getBugWatch(
4792+ ... bug_watch.bugtracker, bug_watch.remotebug))
4793 None
4794
4795 However, the remote bug currently thinks that unlinked_bug does in
4796
4797=== modified file 'lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt'
4798--- lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2018-06-23 00:23:41 +0000
4799+++ lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2018-06-30 11:02:51 +0000
4800@@ -73,7 +73,7 @@
4801 Collect the Example.com watches:
4802
4803 >>> for bug_watch in example_bug_tracker.watches:
4804- ... print "%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus)
4805+ ... print("%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus))
4806 3224: None
4807
4808 And have our special Mantis instance process them:
4809@@ -90,7 +90,7 @@
4810 INFO Updating 1 watches for 1 bugs on http://bugs.some.where
4811
4812 >>> for bug_watch in example_bug_tracker.watches:
4813- ... print "%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus)
4814+ ... print("%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus))
4815 3224: assigned: open
4816
4817 Let's add a few more watches:
4818@@ -143,9 +143,9 @@
4819 >>> for remote_bug_id in sorted(remote_bug_ids):
4820 ... remote_status = remote_statuses[remote_bug_id]
4821 ... expected_remote_status = expected_remote_statuses[remote_bug_id]
4822- ... print 'Remote bug %d' % (remote_bug_id,)
4823- ... print ' * Expected << %s >>' % (expected_remote_status,)
4824- ... print ' * Got << %s >>' % (remote_status,)
4825+ ... print('Remote bug %d' % (remote_bug_id,))
4826+ ... print(' * Expected << %s >>' % (expected_remote_status,))
4827+ ... print(' * Got << %s >>' % (remote_status,))
4828 Remote bug 3224
4829 * Expected << assigned: open >>
4830 * Got << assigned: open >>
4831
4832=== modified file 'lib/lp/bugs/doc/externalbugtracker-mantis.txt'
4833--- lib/lp/bugs/doc/externalbugtracker-mantis.txt 2018-06-23 00:23:41 +0000
4834+++ lib/lp/bugs/doc/externalbugtracker-mantis.txt 2018-06-30 11:02:51 +0000
4835@@ -73,7 +73,7 @@
4836 Collect the Example.com watches:
4837
4838 >>> for bug_watch in example_bug_tracker.watches:
4839- ... print "%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus)
4840+ ... print("%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus))
4841 1550: None
4842
4843 And have our special Mantis instance process them:
4844@@ -92,7 +92,7 @@
4845 INFO Updating 1 watches for 1 bugs on http://bugs.some.where
4846
4847 >>> for bug_watch in example_bug_tracker.watches:
4848- ... print "%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus)
4849+ ... print("%s: %s" % (bug_watch.remotebug, bug_watch.remotestatus))
4850 1550: assigned: open
4851
4852 Let's add a few more watches:
4853@@ -155,9 +155,9 @@
4854 ... expected_remote_statuses)):
4855 ... remote_status = remote_statuses[remote_bug_id]
4856 ... expected_remote_status = expected_remote_statuses[remote_bug_id]
4857- ... print 'Remote bug %d' % (remote_bug_id,)
4858- ... print ' * Expected << %s >>' % (expected_remote_status,)
4859- ... print ' * Got << %s >>' % (remote_status,)
4860+ ... print('Remote bug %d' % (remote_bug_id,))
4861+ ... print(' * Expected << %s >>' % (expected_remote_status,))
4862+ ... print(' * Got << %s >>' % (remote_status,))
4863 Remote bug 1550
4864 * Expected << assigned: open >>
4865 * Got << assigned: open >>
4866
4867=== modified file 'lib/lp/bugs/doc/externalbugtracker-roundup-python-bugs.txt'
4868--- lib/lp/bugs/doc/externalbugtracker-roundup-python-bugs.txt 2009-06-12 16:36:02 +0000
4869+++ lib/lp/bugs/doc/externalbugtracker-roundup-python-bugs.txt 2018-06-30 11:02:51 +0000
4870@@ -50,8 +50,8 @@
4871 >>> for status, resolution in python_bugs_example_statuses:
4872 ... status_string = convert_python_status(status, resolution)
4873 ... status_converted = python_bugs.convertRemoteStatus(status_string)
4874- ... print '(%s, %s) --> %s --> %s' % (
4875- ... status, resolution, status_string, status_converted)
4876+ ... print('(%s, %s) --> %s --> %s' % (
4877+ ... status, resolution, status_string, status_converted))
4878 (open, None) --> 1:None --> New
4879 (open, accepted) --> 1:1 --> Confirmed
4880 (open, duplicate) --> 1:2 --> Confirmed
4881
4882=== modified file 'lib/lp/bugs/doc/externalbugtracker-rt.txt'
4883--- lib/lp/bugs/doc/externalbugtracker-rt.txt 2018-06-22 22:07:42 +0000
4884+++ lib/lp/bugs/doc/externalbugtracker-rt.txt 2018-06-30 11:02:51 +0000
4885@@ -257,13 +257,13 @@
4886 concept of products, only queues, so though there'e a terminology
4887 mismatch the meaning is essentially the same.
4888
4889- >>> print rt.getRemoteProduct(1585)
4890+ >>> print(rt.getRemoteProduct(1585))
4891 OpenSSL-Bugs
4892
4893 If you try to get the remote product of a bug that doesn't exist you'll
4894 get a BugNotFound error.
4895
4896- >>> print rt.getRemoteProduct('this-doesnt-exist')
4897+ >>> print(rt.getRemoteProduct('this-doesnt-exist'))
4898 Traceback (most recent call last):
4899 ...
4900 BugNotFound: this-doesnt-exist
4901@@ -272,5 +272,5 @@
4902 bug, getRemoteProduct() will return None.
4903
4904 >>> del rt.bugs[1589]['queue']
4905- >>> print rt.getRemoteProduct(1589)
4906+ >>> print(rt.getRemoteProduct(1589))
4907 None
4908
4909=== modified file 'lib/lp/bugs/doc/externalbugtracker-sourceforge.txt'
4910--- lib/lp/bugs/doc/externalbugtracker-sourceforge.txt 2018-06-23 00:12:24 +0000
4911+++ lib/lp/bugs/doc/externalbugtracker-sourceforge.txt 2018-06-30 11:02:51 +0000
4912@@ -120,7 +120,7 @@
4913 >>> page_data = open(
4914 ... 'lib/lp/bugs/tests/testfiles/'
4915 ... 'sourceforge-sample-bug-99.html')
4916- >>> print sourceforge._extractErrorMessage(page_data)
4917+ >>> print(sourceforge._extractErrorMessage(page_data))
4918 Artifact: This Artifact Has Been Made Private. Only Group Members
4919 Can View Private ArtifactTypes.
4920
4921@@ -266,13 +266,13 @@
4922 belongs. The remote product is returned by getRemoteProduct() as an
4923 ampersand-separated string.
4924
4925- >>> print sourceforge.getRemoteProduct('1722250')
4926+ >>> print(sourceforge.getRemoteProduct('1722250'))
4927 155120&794532
4928
4929 If you try to get the remote product of a bug that doesn't exist you'll
4930 get a BugNotFound error.
4931
4932- >>> print sourceforge.getRemoteProduct(999999999)
4933+ >>> print(sourceforge.getRemoteProduct(999999999))
4934 Traceback (most recent call last):
4935 ...
4936 BugNotFound: 999999999
4937@@ -284,5 +284,5 @@
4938
4939 >>> with sourceforge.responses():
4940 ... sourceforge.initializeRemoteBugDB([99])
4941- >>> print sourceforge.getRemoteProduct(99)
4942+ >>> print(sourceforge.getRemoteProduct(99))
4943 None
4944
4945=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt'
4946--- lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2018-06-23 02:00:08 +0000
4947+++ lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2018-06-30 11:02:51 +0000
4948@@ -54,7 +54,7 @@
4949 ... raise AssertionError(
4950 ... "Token has already been consumed.")
4951 ... token.consume()
4952- ... print "Successfully validated the token."
4953+ ... print("Successfully validated the token.")
4954 ... cookie_string = (
4955 ... 'trac_auth=random_token-' + str(random.random()))
4956 ... self._xmlrpc_transport.setCookie(cookie_string)
4957@@ -94,7 +94,7 @@
4958 auth_cookie attribute set.
4959
4960 >>> test_transport.cookie_jar
4961- <RequestsCookieJar[Cookie(version=0, name='trac_auth'...
4962+ <RequestsCookieJar[Cookie(version=0, name=u'trac_auth'...
4963
4964 The XML-RPC transport shares its cookiejar with the TracLPPlugin instance.
4965 This is so that the TracLPPlugin can use the cookiejar when authenticating
4966@@ -107,7 +107,7 @@
4967 So if we look in the TracLPPlugin's CookieJar we'll see the same cookie:
4968
4969 >>> trac._cookie_jar
4970- <RequestsCookieJar[Cookie(version=0, name='trac_auth'...
4971+ <RequestsCookieJar[Cookie(version=0, name=u'trac_auth'...
4972
4973 And altering the cookie in the TracLPPlugin's CookieJar will mean, of
4974 course, that it's altered in the XML-RPC transport's CookieJar, too.
4975@@ -118,12 +118,12 @@
4976 ... domain='http://example.com', path='')
4977
4978 >>> trac._cookie_jar
4979- <...CookieJar[Cookie(version=0, name='trac_auth',
4980- value='Look ma, a new cookie!'...>
4981+ <...CookieJar[Cookie(version=0, name=u'trac_auth',
4982+ value=u'Look ma, a new cookie!'...>
4983
4984 >>> test_transport.cookie_jar
4985- <...CookieJar[Cookie(version=0, name='trac_auth',
4986- value='Look ma, a new cookie!'...>
4987+ <...CookieJar[Cookie(version=0, name=u'trac_auth',
4988+ value=u'Look ma, a new cookie!'...>
4989
4990 If authentication fails, a BugTrackerAuthenticationError will be raised.
4991
4992@@ -170,7 +170,7 @@
4993 an authorization request.
4994
4995 >>> test_transport.auth_cookie
4996- Cookie(version=0, name='trac_auth'...)
4997+ Cookie(version=0, name=u'trac_auth'...)
4998 >>> trac.getCurrentDBTime()
4999 datetime.datetime(2008, 4, 9, 2, 2, 1, tzinfo=<UTC>)
5000
The diff has been truncated for viewing.