Merge lp:~costamagnagianfranco/merge-o-matic/merge-o-matic into lp:merge-o-matic

Proposed by Gianfranco Costamagna
Status: Work in progress
Proposed branch: lp:~costamagnagianfranco/merge-o-matic/merge-o-matic
Merge into: lp:merge-o-matic
Diff against target: 257 lines (+28/-28)
20 files modified
check-pool.py (+1/-1)
deb/__init__.py (+1/-1)
deb/controlfile.py (+1/-1)
deb/version.py (+1/-1)
expire-pool.py (+1/-1)
generate-diffs.py (+1/-1)
generate-dpatches.py (+1/-1)
generate-patches.py (+1/-1)
manual-status.py (+4/-4)
merge-status.py (+4/-4)
momlib.py (+2/-2)
produce-merges.py (+1/-1)
publish-patches.py (+1/-1)
stats-graphs.py (+1/-1)
stats.py (+1/-1)
syndicate.py (+1/-1)
update-pool.py (+2/-2)
update-sources.py (+1/-1)
util/__init__.py (+1/-1)
util/tree.py (+1/-1)
To merge this branch: bzr merge lp:~costamagnagianfranco/merge-o-matic/merge-o-matic
Reviewer Review Type Date Requested Status
Brian Murray Needs Fixing
Review via email: mp+441294@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

I had a bit of a look at this and when checking the changes noticed that update-pool.py actually needs to import URLopener from urllib.request instead of urllib. python 3.6.9 is what is on the server behind merges.ubuntu.com

Python 3.6.9 (default, May 24 2023, 15:28:26)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib import URLopener
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'URLopener'
>>> from urllib.request import URLopener
>>>

Subsequently, the merge proposal seems incomplete to me. What kind of testing have you done of your changes? Additionally, are you interested in continuing on working on this?

review: Needs Fixing

Unmerged revisions

383. By Gianfranco Costamagna

Move M-o-M to python3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'check-pool.py'
2--- check-pool.py 2023-02-15 13:29:19 +0000
3+++ check-pool.py 2023-04-18 07:50:46 +0000
4@@ -1,4 +1,4 @@
5-#!/usr/bin/env python
6+#!/usr/bin/env python3
7 # -*- coding: utf-8 -*-
8 # check-pool.py - check the pool against Launchpad
9 #
10
11=== modified file 'deb/__init__.py'
12--- deb/__init__.py 2023-02-17 18:24:58 +0000
13+++ deb/__init__.py 2023-04-18 07:50:46 +0000
14@@ -1,4 +1,4 @@
15-#!/usr/bin/env python
16+#!/usr/bin/env python3
17 # -*- coding: utf-8 -*-
18 #
19 # Copyright © 2008 Canonical Ltd.
20
21=== modified file 'deb/controlfile.py'
22--- deb/controlfile.py 2019-01-25 18:03:15 +0000
23+++ deb/controlfile.py 2023-04-18 07:50:46 +0000
24@@ -1,4 +1,4 @@
25-#!/usr/bin/env python
26+#!/usr/bin/env python3
27 # -*- coding: utf-8 -*-
28 # deb/controlfile.py - parse debian control files
29 #
30
31=== modified file 'deb/version.py'
32--- deb/version.py 2019-01-25 18:28:55 +0000
33+++ deb/version.py 2023-04-18 07:50:46 +0000
34@@ -1,4 +1,4 @@
35-#!/usr/bin/env python
36+#!/usr/bin/env python3
37 # -*- coding: utf-8 -*-
38 # deb/version.py - parse and compare Debian version strings.
39 #
40
41=== modified file 'expire-pool.py'
42--- expire-pool.py 2019-01-25 18:03:15 +0000
43+++ expire-pool.py 2023-04-18 07:50:46 +0000
44@@ -1,4 +1,4 @@
45-#!/usr/bin/env python
46+#!/usr/bin/env python3
47 # -*- coding: utf-8 -*-
48 # expire-pool.py - expires packages from all pools
49 #
50
51=== modified file 'generate-diffs.py'
52--- generate-diffs.py 2023-02-28 20:42:48 +0000
53+++ generate-diffs.py 2023-04-18 07:50:46 +0000
54@@ -1,4 +1,4 @@
55-#!/usr/bin/env python
56+#!/usr/bin/env python3
57 # -*- coding: utf-8 -*-
58 # generate-diffs.py - generate changes and diff files for new packages
59 #
60
61=== modified file 'generate-dpatches.py'
62--- generate-dpatches.py 2019-01-25 18:03:15 +0000
63+++ generate-dpatches.py 2023-04-18 07:50:46 +0000
64@@ -1,4 +1,4 @@
65-#!/usr/bin/env python
66+#!/usr/bin/env python3
67 # -*- coding: utf-8 -*-
68 # generate-dpatches.py - generate extracted debian patches for new packages
69 #
70
71=== modified file 'generate-patches.py'
72--- generate-patches.py 2019-01-25 18:03:15 +0000
73+++ generate-patches.py 2023-04-18 07:50:46 +0000
74@@ -1,4 +1,4 @@
75-#!/usr/bin/env python
76+#!/usr/bin/env python3
77 # -*- coding: utf-8 -*-
78 # generate-patches.py - generate patches between distributions
79 #
80
81=== modified file 'manual-status.py'
82--- manual-status.py 2023-02-15 13:32:24 +0000
83+++ manual-status.py 2023-04-18 07:50:46 +0000
84@@ -1,4 +1,4 @@
85-#!/usr/bin/env python
86+#!/usr/bin/env python3
87 # -*- coding: utf-8 -*-
88 # manual-status.py - output status of manual merges
89 #
90@@ -278,7 +278,7 @@
91 print("}", file=status)
92 print("</style>", file=status)
93 print("<%", file=status)
94- print("import cgi", file=status)
95+ print("import html", file=status)
96 print("from momlib import *", file=status)
97 print("%>", file=status)
98 print("</head>", file=status)
99@@ -474,8 +474,8 @@
100 "<input type=\\"text\\" "
101 "style=\\"border-style: none; background-color: %%s\\" "
102 "name=\\"comment\\" value=\\"%%s\\" title=\\"%%s\\" />" %%
103- (the_color, cgi.escape(the_comment, quote=True),
104- cgi.escape(the_comment))
105+ (the_color, html.escape(the_comment, quote=True),
106+ html.escape(the_comment))
107 )
108 %%>"""
109 )
110
111=== modified file 'merge-status.py'
112--- merge-status.py 2023-02-15 13:32:24 +0000
113+++ merge-status.py 2023-04-18 07:50:46 +0000
114@@ -1,4 +1,4 @@
115-#!/usr/bin/env python
116+#!/usr/bin/env python3
117 # -*- coding: utf-8 -*-
118 # merge-status.py - output merge status
119 #
120@@ -310,7 +310,7 @@
121 print("}", file=status)
122 print("</style>", file=status)
123 print("<%", file=status)
124- print("import cgi", file=status)
125+ print("import html", file=status)
126 print("from momlib import *", file=status)
127 print("%>", file=status)
128 print("</head>", file=status)
129@@ -596,8 +596,8 @@
130 "<input type=\\"text\\" "
131 "style=\\"border-style: none; background-color: %%s\\" "
132 "name=\\"comment\\" value=\\"%%s\\" title=\\"%%s\\" />" %%
133- (the_color, cgi.escape(the_comment, quote=True),
134- cgi.escape(the_comment))
135+ (the_color, html.escape(the_comment, quote=True),
136+ html.escape(the_comment))
137 )
138 %%>"""
139 )
140
141=== modified file 'momlib.py'
142--- momlib.py 2023-02-28 20:42:48 +0000
143+++ momlib.py 2023-04-18 07:50:46 +0000
144@@ -1,4 +1,4 @@
145-#!/usr/bin/env python
146+#!/usr/bin/env python3
147 # -*- coding: utf-8 -*-
148 # momlib.py - common utility functions
149 #
150@@ -20,7 +20,7 @@
151
152 from __future__ import print_function, with_statement
153
154-from cgi import escape
155+from html import escape
156 from collections import defaultdict
157 from contextlib import closing
158 import datetime
159
160=== modified file 'produce-merges.py'
161--- produce-merges.py 2023-02-28 20:42:48 +0000
162+++ produce-merges.py 2023-04-18 07:50:46 +0000
163@@ -1,4 +1,4 @@
164-#!/usr/bin/env python
165+#!/usr/bin/env python3
166 # -*- coding: utf-8 -*-
167 # produce-merges.py - produce merged packages
168 #
169
170=== modified file 'publish-patches.py'
171--- publish-patches.py 2019-01-25 18:03:15 +0000
172+++ publish-patches.py 2023-04-18 07:50:46 +0000
173@@ -1,4 +1,4 @@
174-#!/usr/bin/env python
175+#!/usr/bin/env python3
176 # -*- coding: utf-8 -*-
177 # publish-patches.py - publish patches for the given distribution
178 #
179
180=== modified file 'stats-graphs.py'
181--- stats-graphs.py 2023-02-16 13:17:36 +0000
182+++ stats-graphs.py 2023-04-18 07:50:46 +0000
183@@ -1,4 +1,4 @@
184-#!/usr/bin/env python
185+#!/usr/bin/env python3
186 # -*- coding: utf-8 -*-
187 # stats-graphs.py - output stats graphs
188 #
189
190=== modified file 'stats.py'
191--- stats.py 2019-01-25 18:03:15 +0000
192+++ stats.py 2023-04-18 07:50:46 +0000
193@@ -1,4 +1,4 @@
194-#!/usr/bin/env python
195+#!/usr/bin/env python3
196 # -*- coding: utf-8 -*-
197 # stats.py - collect difference stats
198 #
199
200=== modified file 'syndicate.py'
201--- syndicate.py 2019-01-25 18:24:51 +0000
202+++ syndicate.py 2023-04-18 07:50:46 +0000
203@@ -1,4 +1,4 @@
204-#!/usr/bin/env python
205+#!/usr/bin/env python3
206 # -*- coding: utf-8 -*-
207 # syndicate.py - send out e-mails and update rss feeds
208 #
209
210=== modified file 'update-pool.py'
211--- update-pool.py 2023-02-16 13:20:40 +0000
212+++ update-pool.py 2023-04-18 07:50:46 +0000
213@@ -1,4 +1,4 @@
214-#!/usr/bin/env python
215+#!/usr/bin/env python3
216 # -*- coding: utf-8 -*-
217 # update-pool.py - update a distribution's pool
218 #
219@@ -138,7 +138,7 @@
220 raise RuntimeError("Don't know how to decompress %s" % url)
221 with decompressor(compfilename) as compfile:
222 ensure(filename)
223- with open(filename, "w") as local:
224+ with open(filename, "wb") as local:
225 local.write(compfile.read())
226 finally:
227 os.unlink(compfilename)
228
229=== modified file 'update-sources.py'
230--- update-sources.py 2019-01-25 18:03:15 +0000
231+++ update-sources.py 2023-04-18 07:50:46 +0000
232@@ -1,4 +1,4 @@
233-#!/usr/bin/env python
234+#!/usr/bin/env python3
235 # -*- coding: utf-8 -*-
236 # update-sources.py - update the Sources files in a distribution's pool
237 #
238
239=== modified file 'util/__init__.py'
240--- util/__init__.py 2023-02-16 17:16:32 +0000
241+++ util/__init__.py 2023-04-18 07:50:46 +0000
242@@ -1,4 +1,4 @@
243-#!/usr/bin/env python
244+#!/usr/bin/env python3
245 # -*- coding: utf-8 -*-
246 #
247 # Copyright © 2008 Canonical Ltd.
248
249=== modified file 'util/tree.py'
250--- util/tree.py 2023-02-16 17:33:42 +0000
251+++ util/tree.py 2023-04-18 07:50:46 +0000
252@@ -1,4 +1,4 @@
253-#!/usr/bin/env python
254+#!/usr/bin/env python3
255 # -*- coding: utf-8 -*-
256 # util/tree.py - useful functions for dealing with trees of files
257 #

Subscribers

People subscribed via source and target branches

to status/vote changes: