Merge lp:~salgado/launchpad/python2.5-and-2.6 into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/python2.5-and-2.6
Merge into: lp:launchpad
Diff against target: 716 lines (+205/-77)
27 files modified
buildout-templates/_pythonpath.py.in (+6/-0)
buildout-templates/bin/test.in (+14/-3)
ez_setup.py (+11/-3)
lib/canonical/buildd/tests/test_generate_translation_templates.py (+1/-1)
lib/canonical/database/ftests/script_isolation.py (+8/-0)
lib/canonical/launchpad/daemons/tachandler.py (+7/-1)
lib/canonical/launchpad/doc/gpghandler.txt (+1/-1)
lib/canonical/launchpad/doc/incomingmail.txt (+1/-1)
lib/canonical/launchpad/testing/googletestservice.py (+1/-1)
lib/canonical/launchpad/tests/test_helpers.py (+4/-2)
lib/canonical/launchpad/utilities/gpghandler.py (+16/-2)
lib/canonical/launchpad/validators/url.py (+7/-1)
lib/canonical/lazr/doc/timeout.txt (+1/-1)
lib/lp/bugs/tests/bugs-emailinterface.txt (+3/-5)
lib/lp/codehosting/puller/tests/test_acceptance.py (+36/-1)
lib/lp/poppy/daemon.py (+7/-0)
lib/lp/services/mailman/doc/deactivate-lists.txt (+4/-2)
lib/lp/soyuz/doc/buildd-dispatching.txt (+2/-2)
lib/lp/soyuz/doc/buildd-slave.txt.disabled (+1/-1)
lib/lp/soyuz/doc/manage-chroot.txt (+1/-1)
lib/lp/translations/doc/poexport-language-pack.txt (+38/-29)
lib/lp/translations/doc/poexport-request-productseries.txt (+5/-3)
lib/lp/translations/doc/poexport-request.txt (+4/-2)
lib/lp/translations/doc/potemplate.txt (+6/-3)
lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt (+7/-3)
lib/lp/translations/utilities/doc/gettext_mo_exporter.txt (+7/-5)
lib/lp/translations/utilities/doc/launchpad_write_tarfile.txt (+6/-3)
To merge this branch: bzr merge lp:~salgado/launchpad/python2.5-and-2.6
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Review via email: mp+24121@code.launchpad.net

Description of the change

Make sure the test suite passes on both python2.5 and python2.6.

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

merge-conditional

Woohoo!

Edited IRC transcript.

[09:47am] maxb: salgado: Perhaps the DeprecationWarning suppressions that are stopgap measures should all be XXXed before being allowed into trunk?
[09:59am] salgado: maxb, yeah, definitely. I'll do that
[10:02am] gary_poster: maxb, salgado +1. I also wondered if importfascist (or landscape's reimplementation) could somehow not have the behavior you described, but my only interest right now is maybe mentioning this in a bug report as a way to better focus the deprecation warnings again. I don't want to spend time right now thinking about whether that's even possible. Of course, if you know already that it is not possible, nm
[10:06am] gary_poster: salgado, generally would like to see bugs for all of the new XXXs (the py 2.5 hacks in particular--I suggest that they could all be grouped together)
[10:11am] gary_poster: salgado: looking at lines 276-281 of the diff. In lib/lp/bugs/tests/bugs-emailinterface.txt you deleted the following:
[10:11am] gary_poster: -This does not affect the processing. Note though that the filename from
[10:11am] gary_poster: -the content-type header is ignored, even if the content-disposition
[10:11am] gary_poster: -header does not provide a filename.
[10:11am] gary_poster: Is that because in Python 2.6 we now honor the content-type filename?
[10:12am] salgado: gary_poster, yes, and since that doesn't seem to be important to us I've changed the test to not mention it and elide the thing
[10:12am] gary_poster: cool
[10:13am] salgado: gary_poster, I was thinking of having just one bug for the python2.5 hacks left behind
[10:14am] gary_poster: good, yes
[10:15am] gary_poster: salgado: you have this XXX on line 394 of the diff (in lib/lp/services/mailman/doc/deactivate-lists.txt) but not on line 196 (in lib/canonical/launchpad/tests/test_helpers.py). I don't have a strong feeling abot whether it is necessary, but we ought to be consistent. My inclination is to have it be another Python 2.5 XXX.
[10:15am] gary_poster: # XXX: The .rstrip('/') is to make this pass on python2.5 and 2.6.
[10:16am] gary_poster: Actually you are consistent in other places, so it just looks like an oversight that the one in test_helpers.py doesn't have an XXX
[10:16am] salgado: yeah, I missed that
[10:22am] gary_poster: salgado: last topic is that I was looking at mwhudson's bug/hack (https://bugs.edge.launchpad.net/launchpad-code/+bug/564375). The thing I don't see is the proper fix. Is the proper fix in Python's HttpServer? If so, have we made a bug in the Python bug tracker? If not...what do we need to change in the future? If you are not sure, I won't let this keep you from landing, but I would like you and/or mwhudson to follow up in that regard.
[10:25am] salgado: I'm not sure, but I'll comment on the bug asking what the proper fix would be, if that's ok with you
[10:27am] maxb: The proper fix would be for SocketServer to provide a documented way of breaking it out of its select loop
[10:28am] gary_poster: that makes sense, maxb--which would be a Python bug. thanks salgado, yes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/_pythonpath.py.in'
2--- buildout-templates/_pythonpath.py.in 2010-04-20 19:10:35 +0000
3+++ buildout-templates/_pythonpath.py.in 2010-04-27 20:46:29 +0000
4@@ -12,7 +12,13 @@
5
6 import os
7 import sys
8+import warnings
9
10+# XXX: 2010-04-26, Salgado, bug=570246: Silence python2.6 deprecation
11+# warnings.
12+warnings.filterwarnings(
13+ 'ignore', '.*(md5|sha|sets)', DeprecationWarning,
14+ )
15
16 site_dir = ${scripts:parts-directory|path-repr}
17
18
19=== modified file 'buildout-templates/bin/test.in'
20--- buildout-templates/bin/test.in 2010-04-20 19:10:35 +0000
21+++ buildout-templates/bin/test.in 2010-04-27 20:46:29 +0000
22@@ -98,7 +98,7 @@
23 # need to be silenced should have an accompanied Bug reference.
24 #
25 warnings.filterwarnings(
26- 'ignore', 'PyCrypto', RuntimeWarning, 'twisted[.]conch[.]ssh'
27+ 'ignore', 'PyCrypto', RuntimeWarning, 'twisted[.]conch[.]ssh',
28 )
29 warnings.filterwarnings(
30 'ignore', 'twisted.python.plugin', DeprecationWarning,
31@@ -107,8 +107,19 @@
32 'ignore', 'zope.testing.doctest', DeprecationWarning,
33 )
34 warnings.filterwarnings(
35- 'ignore', 'bzrlib.*was deprecated', DeprecationWarning
36-)
37+ 'ignore', 'bzrlib.*was deprecated', DeprecationWarning,
38+ )
39+# XXX: 2010-04-26, Salgado, bug=570246: Silence python2.6 deprecation
40+# warnings.
41+# We cannot narrow this warnings filter to just twisted because
42+# warnings.warn_explicit() sees this import as coming from importfascist, not
43+# from twisted. It makes no sense to put module='importfascist' here though
44+# because /everything/ gets imported through it. So, sad as it is, until
45+# twisted doesn't produce warnings under Python 2.6, just ignore all these
46+# deprecations.
47+warnings.filterwarnings(
48+ 'ignore', '.*(md5|sha|sets)', DeprecationWarning,
49+ )
50 # The next one is caused by a lamosity in python-openid. The following change
51 # to openid/server/server.py would make the warning filter unnecessary:
52 # 978c974,974
53
54=== modified file 'ez_setup.py'
55--- ez_setup.py 2009-05-31 22:17:45 +0000
56+++ ez_setup.py 2010-04-27 20:46:29 +0000
57@@ -3,7 +3,6 @@
58 # NOTE TO LAUNCHPAD DEVELOPERS: This is a bootstrapping file from the
59 # setuptools project. It is imported by our setup.py.
60
61-#!python
62 """Bootstrap setuptools installation
63
64 If you want to use setuptools in your package's setup.py, just include this
65@@ -19,7 +18,7 @@
66 This file can also be run as a script to install or upgrade setuptools.
67 """
68 import sys
69-DEFAULT_VERSION = "0.6c9"
70+DEFAULT_VERSION = "0.6c11"
71 DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
72
73 md5_data = {
74@@ -33,6 +32,14 @@
75 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
76 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
77 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
78+ 'setuptools-0.6c10-py2.3.egg': 'ce1e2ab5d3a0256456d9fc13800a7090',
79+ 'setuptools-0.6c10-py2.4.egg': '57d6d9d6e9b80772c59a53a8433a5dd4',
80+ 'setuptools-0.6c10-py2.5.egg': 'de46ac8b1c97c895572e5e8596aeb8c7',
81+ 'setuptools-0.6c10-py2.6.egg': '58ea40aef06da02ce641495523a0b7f5',
82+ 'setuptools-0.6c11-py2.3.egg': '2baeac6e13d414a9d28e7ba5b5a596de',
83+ 'setuptools-0.6c11-py2.4.egg': 'bd639f9b0eac4c42497034dec2ec0c2b',
84+ 'setuptools-0.6c11-py2.5.egg': '64c94f3bf7a72a13ec83e0b24f2749b2',
85+ 'setuptools-0.6c11-py2.6.egg': 'bfa92100bd772d5a213eedd356d64086',
86 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
87 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
88 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
89@@ -97,7 +104,7 @@
90 try:
91 import pkg_resources
92 except ImportError:
93- return do_download()
94+ return do_download()
95 try:
96 pkg_resources.require("setuptools>="+version); return
97 except pkg_resources.VersionConflict, e:
98@@ -278,3 +285,4 @@
99
100
101
102+
103
104=== modified file 'lib/canonical/buildd/tests/test_generate_translation_templates.py'
105--- lib/canonical/buildd/tests/test_generate_translation_templates.py 2010-03-18 13:27:47 +0000
106+++ lib/canonical/buildd/tests/test_generate_translation_templates.py 2010-04-27 20:46:29 +0000
107@@ -92,7 +92,7 @@
108 os.path.dirname(__file__),'dummy_templates.tar.gz')
109 tar = tarfile.open(dummy_tar, 'r|*')
110 tar.extractall(branchdir)
111- potnames = [name for name in tar.getnames() if not name.endswith('/')]
112+ potnames = [member.name for member in tar.getmembers() if not member.isdir()]
113 tar.close()
114
115 generator = GenerateTranslationTemplates(
116
117=== modified file 'lib/canonical/database/ftests/script_isolation.py'
118--- lib/canonical/database/ftests/script_isolation.py 2009-08-13 15:12:16 +0000
119+++ lib/canonical/database/ftests/script_isolation.py 2010-04-27 20:46:29 +0000
120@@ -8,6 +8,14 @@
121 __metaclass__ = type
122 __all__ = []
123
124+import warnings
125+
126+# XXX: 2010-04-26, Salgado, bug=570246: Silence python2.6 deprecation
127+# warnings.
128+warnings.filterwarnings(
129+ 'ignore', '.*(md5|sha|sets)', DeprecationWarning,
130+ )
131+
132 from canonical.database.sqlbase import cursor, ISOLATION_LEVEL_SERIALIZABLE
133 from canonical.launchpad.scripts import execute_zcml_for_scripts
134 from canonical.lp import initZopeless
135
136=== modified file 'lib/canonical/launchpad/daemons/tachandler.py'
137--- lib/canonical/launchpad/daemons/tachandler.py 2010-04-05 09:22:54 +0000
138+++ lib/canonical/launchpad/daemons/tachandler.py 2010-04-27 20:46:29 +0000
139@@ -128,7 +128,13 @@
140 remove_if_exists(self.logfile)
141
142 self.setUpRoot()
143- args = [sys.executable, twistd_script, '-o', '-y', self.tacfile,
144+ args = [sys.executable,
145+ # XXX: 2010-04-26, Salgado, bug=570246: Deprecation warnings
146+ # in Twisted are not our problem. They also aren't easy to
147+ # suppress, and cause test failures due to spurious stderr
148+ # output. Just shut the whole bloody mess up.
149+ '-Wignore::DeprecationWarning',
150+ twistd_script, '-o', '-y', self.tacfile,
151 '--pidfile', self.pidfile, '--logfile', self.logfile]
152 if spew:
153 args.append('--spew')
154
155=== modified file 'lib/canonical/launchpad/doc/gpghandler.txt'
156--- lib/canonical/launchpad/doc/gpghandler.txt 2010-04-20 21:20:43 +0000
157+++ lib/canonical/launchpad/doc/gpghandler.txt 2010-04-27 20:46:29 +0000
158@@ -332,7 +332,7 @@
159 Traceback (most recent call last):
160 ...
161 GPGUploadFailure: Could not reach keyserver at
162- http://localhost:11371 (111, 'Connection refused')
163+ http://localhost:11371...Connection refused...
164
165
166 == Fingerprint sanitizing ==
167
168=== modified file 'lib/canonical/launchpad/doc/incomingmail.txt'
169--- lib/canonical/launchpad/doc/incomingmail.txt 2010-03-02 14:37:56 +0000
170+++ lib/canonical/launchpad/doc/incomingmail.txt 2010-04-27 20:46:29 +0000
171@@ -360,7 +360,7 @@
172 >>> handleMail(transaction)
173 ERROR:...:Upload to Librarian failed...
174 ...
175- UploadFailed: [...]: (111, 'Connection refused')
176+ UploadFailed: ...Connection refused...
177
178 >>> len(stub.test_emails)
179 2
180
181=== modified file 'lib/canonical/launchpad/testing/googletestservice.py'
182--- lib/canonical/launchpad/testing/googletestservice.py 2009-10-17 14:06:03 +0000
183+++ lib/canonical/launchpad/testing/googletestservice.py 2010-04-27 20:46:29 +0000
184@@ -125,7 +125,7 @@
185 try:
186 sock.connect((host, port))
187 except socket.error, err:
188- if err.args[0] == errno.ECONNREFUSED:
189+ if err.args[0] in [errno.ECONNREFUSED, errno.ECONNABORTED]:
190 elapsed = (time.time() - start)
191 if elapsed > timeout:
192 raise RuntimeError("Socket poll time exceeded.")
193
194=== modified file 'lib/canonical/launchpad/tests/test_helpers.py'
195--- lib/canonical/launchpad/tests/test_helpers.py 2009-07-17 00:26:05 +0000
196+++ lib/canonical/launchpad/tests/test_helpers.py 2010-04-27 20:46:29 +0000
197@@ -55,8 +55,10 @@
198
199 Check the expected files are in the archive.
200
201- >>> tarball.getnames()
202- ['test/', 'test/cy.po', 'test/es.po', 'test/test.pot']
203+ # XXX: 2010-04-26, Salgado, bug=570244: This rstrip('/') is to make the
204+ # test pass on python2.5 and 2.6.
205+ >>> [name.rstrip('/') for name in tarball.getnames()]
206+ ['test', 'test/cy.po', 'test/es.po', 'test/test.pot']
207
208 Check the contents.
209
210
211=== modified file 'lib/canonical/launchpad/utilities/gpghandler.py'
212--- lib/canonical/launchpad/utilities/gpghandler.py 2010-04-20 18:55:06 +0000
213+++ lib/canonical/launchpad/utilities/gpghandler.py 2010-04-27 20:46:29 +0000
214@@ -160,7 +160,14 @@
215 try:
216 signatures = ctx.verify(sig, plain, None)
217 except gpgme.GpgmeError, e:
218- raise GPGVerificationError(e.message)
219+ # XXX: 2010-04-26, Salgado, bug=570244: This hack is needed
220+ # for python2.5 compatibility. We should remove it when we no
221+ # longer need to run on python2.5.
222+ if hasattr(e, 'message'):
223+ msg = e.message
224+ else:
225+ msg = e.strerror
226+ raise GPGVerificationError(msg)
227 else:
228 # store clearsigned signature
229 sig = StringIO(content)
230@@ -170,7 +177,14 @@
231 try:
232 signatures = ctx.verify(sig, None, plain)
233 except gpgme.GpgmeError, e:
234- raise GPGVerificationError(e.message)
235+ # XXX: 2010-04-26, Salgado, bug=570244: This hack is needed
236+ # for python2.5 compatibility. We should remove it when we no
237+ # longer need to run on python2.5.
238+ if hasattr(e, 'message'):
239+ msg = e.message
240+ else:
241+ msg = e.strerror
242+ raise GPGVerificationError(msg)
243
244 # XXX jamesh 2006-01-31:
245 # We raise an exception if we don't get exactly one signature.
246
247=== modified file 'lib/canonical/launchpad/validators/url.py'
248--- lib/canonical/launchpad/validators/url.py 2009-06-25 05:30:52 +0000
249+++ lib/canonical/launchpad/validators/url.py 2010-04-27 20:46:29 +0000
250@@ -21,8 +21,14 @@
251 True
252 >>> valid_absolute_url('http://www.example.com')
253 True
254- >>> valid_absolute_url('whatever://example.com/blah')
255+ >>> valid_absolute_url('whatever:/uxample.com/blah')
256 False
257+
258+ # XXX: 2010-04-26, Salgado, bug=570244: This test only works against
259+ # python2.6 but we still need to run on python2.5, so we should uncomment
260+ # it only when we no longer need to run on 2.5.
261+ >>> #valid_absolute_url('whatever://example.com/blah')
262+ True
263 """
264 # Have to import urlparse locally since imports from helpers.py
265 # causes this module to be imported, and we can't import stuff from
266
267=== modified file 'lib/canonical/lazr/doc/timeout.txt'
268--- lib/canonical/lazr/doc/timeout.txt 2008-06-23 12:15:18 +0000
269+++ lib/canonical/lazr/doc/timeout.txt 2010-04-27 20:46:29 +0000
270@@ -173,7 +173,7 @@
271 >>> urlfetch(http_server_url)
272 Traceback (most recent call last):
273 ...
274- URLError: ...'Connection refused'...
275+ URLError: ...Connection refused...
276
277 After the listen() is called, connections will hang until accept() is
278 called, so a TimeoutError will be raised.
279
280=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
281--- lib/lp/bugs/tests/bugs-emailinterface.txt 2010-04-15 14:02:10 +0000
282+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2010-04-27 20:46:29 +0000
283@@ -2776,10 +2776,8 @@
284 this is not a real JPG file
285
286 Some mail clients append a filename to the content type of attachments.
287-This does not affect the processing. Note though that the filename from
288-the content-type header is ignored, even if the content-disposition
289-header does not provide a filename. The content type of the PGP signature
290-is properly detected and thus no bug attchement created.
291+The content type of the PGP signature is properly detected and thus no bug
292+attachment is created.
293
294 >>> submit_mail = """From: Sample Person <test@canonical.com>
295 ... To: new@bugs.canonical.com
296@@ -2824,7 +2822,7 @@
297 >>>
298 >>> process_email(submit_mail)
299 >>> print_attachments(get_latest_added_bug().attachments)
300- LibraryFileAlias unnamed image/jpeg; name="image.jpg" UNSPECIFIED
301+ LibraryFileAlias ... image/jpeg; name="image.jpg" UNSPECIFIED
302 this is not a real JPG file
303 LibraryFileAlias sourcefile.diff text/x-diff; name="sourcefile1.diff" PATCH
304 this should be diff output.
305
306=== modified file 'lib/lp/codehosting/puller/tests/test_acceptance.py'
307--- lib/lp/codehosting/puller/tests/test_acceptance.py 2010-04-15 01:30:39 +0000
308+++ lib/lp/codehosting/puller/tests/test_acceptance.py 2010-04-27 20:46:29 +0000
309@@ -8,6 +8,7 @@
310
311
312 import os
313+import socket
314 from subprocess import PIPE, Popen
315 import unittest
316
317@@ -18,6 +19,8 @@
318 from bzrlib.config import TransportConfig
319 from bzrlib import errors
320 from bzrlib.tests import HttpServer
321+from bzrlib.tests.http_server import (
322+ TestingHTTPServer, TestingThreadingHTTPServer)
323 from bzrlib.transport import get_transport
324 from bzrlib.upgrade import upgrade
325 from bzrlib.urlutils import join as urljoin, local_path_from_url
326@@ -33,6 +36,38 @@
327 from canonical.testing import ZopelessAppServerLayer
328
329
330+# XXX MichaelHudson, bug=564375: With changes to the SocketServer module in
331+# Python 2.6 the thread created in serveOverHTTP cannot be joined, because
332+# HttpServer.stop_server doesn't do enough to get the thread out of the select
333+# call in SocketServer.BaseServer.handle_request(). So what follows is
334+# slightly horrible code to use the version of handle_request from Python 2.5.
335+
336+def fixed_handle_request(self):
337+ """Handle one request, possibly blocking. """
338+ try:
339+ request, client_address = self.get_request()
340+ except socket.error:
341+ return
342+ if self.verify_request(request, client_address):
343+ try:
344+ self.process_request(request, client_address)
345+ except:
346+ self.handle_error(request, client_address)
347+ self.close_request(request)
348+
349+
350+class FixedTHS(TestingHTTPServer):
351+ handle_request = fixed_handle_request
352+
353+
354+class FixedTTHS(TestingThreadingHTTPServer):
355+ handle_request = fixed_handle_request
356+
357+
358+class FixedHttpServer(HttpServer):
359+ http_server_class = {'HTTP/1.0': FixedTHS, 'HTTP/1.1': FixedTTHS}
360+
361+
362 class TestBranchPuller(PullerBranchTestCase):
363 """Integration tests for the branch puller.
364
365@@ -135,7 +170,7 @@
366
367 def serveOverHTTP(self):
368 """Serve the current directory over HTTP, returning the server URL."""
369- http_server = HttpServer()
370+ http_server = FixedHttpServer()
371 http_server.start_server()
372 # Join cleanup added before the tearDown so the tearDown is executed
373 # first as this tells the thread to die. We then join explicitly as
374
375=== modified file 'lib/lp/poppy/daemon.py'
376--- lib/lp/poppy/daemon.py 2010-03-17 12:26:14 +0000
377+++ lib/lp/poppy/daemon.py 2010-04-27 20:46:29 +0000
378@@ -9,11 +9,18 @@
379 ]
380
381 import optparse
382+import warnings
383
384 from canonical.launchpad.scripts import logger, logger_options
385 from lp.poppy.hooks import Hooks
386 from lp.poppy.server import run_server
387
388+# XXX: 2010-04-26, Salgado, bug=570246: Silence python2.6 deprecation
389+# warnings.
390+warnings.filterwarnings(
391+ 'ignore', '.*(md5|sha|sets)', DeprecationWarning,
392+ )
393+
394
395 def main():
396 parser = optparse.OptionParser()
397
398=== modified file 'lib/lp/services/mailman/doc/deactivate-lists.txt'
399--- lib/lp/services/mailman/doc/deactivate-lists.txt 2009-06-23 19:33:57 +0000
400+++ lib/lp/services/mailman/doc/deactivate-lists.txt 2010-04-27 20:46:29 +0000
401@@ -42,7 +42,9 @@
402 >>> import tarfile
403 >>> tarball = tarfile.open(backup_file, 'r:gz')
404 >>> for name in sorted(tarball.getnames()):
405- ... print name
406- itest-one/
407+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
408+ ... # make this pass on python2.5 and 2.6.
409+ ... print name.rstrip('/')
410+ itest-one
411 itest-one/config.pck
412 itest-one/config.pck.last
413
414=== modified file 'lib/lp/soyuz/doc/buildd-dispatching.txt'
415--- lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-09 15:46:09 +0000
416+++ lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-27 20:46:29 +0000
417@@ -67,10 +67,10 @@
418 builder and was reset due to a communication time-out.
419
420 >>> builder_set.checkBuilders(logger, transaction)
421- WARNING:root:Resetting builder: http://localhost:9221/ -- (111, 'Connection refused')
422+ WARNING:root:Resetting builder: http://localhost:9221/...Connection refused...
423 Traceback (most recent call last):
424 ...
425- error: (111, 'Connection refused')
426+ error: ...Connection refused...
427
428 The 'frog' builder was not marked as failed.
429
430
431=== modified file 'lib/lp/soyuz/doc/buildd-slave.txt.disabled'
432--- lib/lp/soyuz/doc/buildd-slave.txt.disabled 2010-04-03 03:38:55 +0000
433+++ lib/lp/soyuz/doc/buildd-slave.txt.disabled 2010-04-27 20:46:29 +0000
434@@ -94,4 +94,4 @@
435 >>> s.info()
436 Traceback (most recent call last):
437 ...
438- error: (111, 'Connection refused')
439+ error: ...Connection refused...
440
441=== modified file 'lib/lp/soyuz/doc/manage-chroot.txt'
442--- lib/lp/soyuz/doc/manage-chroot.txt 2009-04-28 12:59:43 +0000
443+++ lib/lp/soyuz/doc/manage-chroot.txt 2010-04-27 20:46:29 +0000
444@@ -193,6 +193,6 @@
445 ... else:
446 ... print "Did not get expected exception"
447 DEBUG Initialising ChrootManager for 'The Hoary Hedgehog Release for i386 (x86)'
448- Librarian upload failed: [...]: (111, 'Connection refused')
449+ Librarian upload failed: ...Connection refused...
450
451 >>> LibrarianLayer.reveal()
452
453=== modified file 'lib/lp/translations/doc/poexport-language-pack.txt'
454--- lib/lp/translations/doc/poexport-language-pack.txt 2009-11-17 09:50:33 +0000
455+++ lib/lp/translations/doc/poexport-language-pack.txt 2010-04-27 20:46:29 +0000
456@@ -55,7 +55,9 @@
457 ... size = 'bin'
458 ... else:
459 ... size = len(tarfile.extractfile(member).readlines())
460- ... print "| %5s | %s" % (size, member.name)
461+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
462+ ... # make this pass on python2.5 and 2.6.
463+ ... print "| %5s | %s" % (size, member.name.rstrip('/'))
464
465
466 == Base language pack export using Librarian ==
467@@ -92,12 +94,14 @@
468
469 The tarball has the right members.
470
471- >>> for name in tarfile.getnames():
472- ... print name
473- rosetta-hoary/
474+ >>> for member in tarfile.getmembers():
475+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
476+ ... # make this pass on python2.5 and 2.6.
477+ ... print member.name.rstrip('/')
478+ rosetta-hoary
479 ...
480- rosetta-hoary/es/
481- rosetta-hoary/es/LC_MESSAGES/
482+ rosetta-hoary/es
483+ rosetta-hoary/es/LC_MESSAGES
484 rosetta-hoary/es/LC_MESSAGES/pmount.po
485 ...
486 rosetta-hoary/timestamp.txt
487@@ -105,7 +109,12 @@
488
489 Directory permissions allow correct use of those directories:
490
491- >>> directory = tarfile.getmember('rosetta-hoary/')
492+ # XXX: 2010-04-26, Salgado, bug=570244: This try/except is needed to make
493+ # the test pass on python2.5 and 2.6.
494+ >>> try:
495+ ... directory = tarfile.getmember('rosetta-hoary/')
496+ ... except KeyError:
497+ ... directory = tarfile.getmember('rosetta-hoary')
498 >>> oct(directory.mode)
499 '0755'
500
501@@ -223,11 +232,11 @@
502
503 >>> tarfile = string_to_tarfile(language_pack.file.read())
504 >>> examine_tarfile(tarfile)
505- | - | rosetta-grumpy/
506+ | - | rosetta-grumpy
507 | 1 | rosetta-grumpy/mapping.txt
508 | 1 | rosetta-grumpy/timestamp.txt
509- | - | rosetta-grumpy/xpi/
510- | - | rosetta-grumpy/xpi/firefox/
511+ | - | rosetta-grumpy/xpi
512+ | - | rosetta-grumpy/xpi/firefox
513 | bin | rosetta-grumpy/xpi/firefox/en-US.xpi
514 | 94 | rosetta-grumpy/xpi/firefox/en.po
515 | 102 | rosetta-grumpy/xpi/firefox/es.po
516@@ -345,17 +354,17 @@
517 # Get the generated tarball.
518 >>> tarfile = string_to_tarfile(language_pack.file.read())
519 >>> examine_tarfile(tarfile)
520- | - | rosetta-grumpy/
521- | - | rosetta-grumpy/cy/
522- | - | rosetta-grumpy/cy/LC_MESSAGES/
523+ | - | rosetta-grumpy
524+ | - | rosetta-grumpy/cy
525+ | - | rosetta-grumpy/cy/LC_MESSAGES
526 | 21 | rosetta-grumpy/cy/LC_MESSAGES/test.po
527- | - | rosetta-grumpy/es/
528- | - | rosetta-grumpy/es/LC_MESSAGES/
529+ | - | rosetta-grumpy/es
530+ | - | rosetta-grumpy/es/LC_MESSAGES
531 | 21 | rosetta-grumpy/es/LC_MESSAGES/test.po
532 | 2 | rosetta-grumpy/mapping.txt
533 | 1 | rosetta-grumpy/timestamp.txt
534- | - | rosetta-grumpy/xpi/
535- | - | rosetta-grumpy/xpi/firefox/
536+ | - | rosetta-grumpy/xpi
537+ | - | rosetta-grumpy/xpi/firefox
538 | bin | rosetta-grumpy/xpi/firefox/en-US.xpi
539 | 94 | rosetta-grumpy/xpi/firefox/en.po
540 | 102 | rosetta-grumpy/xpi/firefox/es.po
541@@ -444,14 +453,14 @@
542 xpi entries because those are outside the scope of this test.
543
544 >>> examine_tarfile(tarfile)
545- | - | rosetta-grumpy/
546- | - | rosetta-grumpy/cy/
547- | - | rosetta-grumpy/cy/LC_MESSAGES/
548+ | - | rosetta-grumpy
549+ | - | rosetta-grumpy/cy
550+ | - | rosetta-grumpy/cy/LC_MESSAGES
551 | 21 | rosetta-grumpy/cy/LC_MESSAGES/test.po
552 | 2 | rosetta-grumpy/mapping.txt
553 | 1 | rosetta-grumpy/timestamp.txt
554- | - | rosetta-grumpy/xpi/
555- | - | rosetta-grumpy/xpi/firefox/
556+ | - | rosetta-grumpy/xpi
557+ | - | rosetta-grumpy/xpi/firefox
558 | bin | rosetta-grumpy/xpi/firefox/en-US.xpi
559 | 94 | rosetta-grumpy/xpi/firefox/en.po
560 | 102 | rosetta-grumpy/xpi/firefox/es.po
561@@ -489,17 +498,17 @@
562
563 >>> tarfile = string_to_tarfile(language_pack.file.read())
564 >>> examine_tarfile(tarfile)
565- | - | rosetta-grumpy/
566- | - | rosetta-grumpy/cy/
567- | - | rosetta-grumpy/cy/LC_MESSAGES/
568+ | - | rosetta-grumpy
569+ | - | rosetta-grumpy/cy
570+ | - | rosetta-grumpy/cy/LC_MESSAGES
571 | 21 | rosetta-grumpy/cy/LC_MESSAGES/test.po
572- | - | rosetta-grumpy/es/
573- | - | rosetta-grumpy/es/LC_MESSAGES/
574+ | - | rosetta-grumpy/es
575+ | - | rosetta-grumpy/es/LC_MESSAGES
576 | 21 | rosetta-grumpy/es/LC_MESSAGES/test.po
577 | 2 | rosetta-grumpy/mapping.txt
578 | 1 | rosetta-grumpy/timestamp.txt
579- | - | rosetta-grumpy/xpi/
580- | - | rosetta-grumpy/xpi/firefox/
581+ | - | rosetta-grumpy/xpi
582+ | - | rosetta-grumpy/xpi/firefox
583 | bin | rosetta-grumpy/xpi/firefox/en-US.xpi
584 | 94 | rosetta-grumpy/xpi/firefox/en.po
585 | 102 | rosetta-grumpy/xpi/firefox/es.po
586
587=== modified file 'lib/lp/translations/doc/poexport-request-productseries.txt'
588--- lib/lp/translations/doc/poexport-request-productseries.txt 2010-03-05 15:31:22 +0000
589+++ lib/lp/translations/doc/poexport-request-productseries.txt 2010-04-27 20:46:29 +0000
590@@ -90,10 +90,12 @@
591 >>> from canonical.launchpad.helpers import string_to_tarfile
592 >>> tarball = string_to_tarfile(urllib2.urlopen(url).read())
593 >>> for name in sorted(tarball.getnames()):
594- ... print name
595- evolution-2.2/
596+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
597+ ... # make this pass on python2.5 and 2.6.
598+ ... print name.rstrip('/')
599+ evolution-2.2
600 evolution-2.2/evolution-2.2-es.po
601- po/
602+ po
603 po/evolution-2.2-test-pt_BR.po
604 po/evolution-2.2-test.pot
605 po/evolution-2.2.pot
606
607=== modified file 'lib/lp/translations/doc/poexport-request.txt'
608--- lib/lp/translations/doc/poexport-request.txt 2010-03-05 20:40:40 +0000
609+++ lib/lp/translations/doc/poexport-request.txt 2010-04-27 20:46:29 +0000
610@@ -108,8 +108,10 @@
611 >>> from canonical.launchpad.helpers import string_to_tarfile
612 >>> tarball = string_to_tarfile(urllib2.urlopen(url).read())
613 >>> for name in sorted(tarball.getnames()):
614- ... print name
615- pmount/
616+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
617+ ... # make this pass on python2.5 and 2.6.
618+ ... print name.rstrip('/')
619+ pmount
620 pmount/pmount-ca.po
621 pmount/pmount-cs.po
622
623
624=== modified file 'lib/lp/translations/doc/potemplate.txt'
625--- lib/lp/translations/doc/potemplate.txt 2009-11-01 22:50:17 +0000
626+++ lib/lp/translations/doc/potemplate.txt 2010-04-27 20:46:29 +0000
627@@ -619,10 +619,13 @@
628 >>> from canonical.launchpad.helpers import string_to_tarfile
629 >>> tarfile_string = exported_translation_file.read()
630 >>> tarfile = string_to_tarfile(tarfile_string)
631- >>> sorted(tarfile.getnames())
632- ['evolution-2.2/', 'evolution-2.2/evolution-2.2-es.po',
633+
634+ # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to make this
635+ # pass on python2.5 and 2.6.
636+ >>> sorted(name.rstrip('/') for name in tarfile.getnames())
637+ ['evolution-2.2', 'evolution-2.2/evolution-2.2-es.po',
638 'evolution-2.2/evolution-2.2-ja.po', 'evolution-2.2/evolution-2.2-xh.po',
639- 'po/', 'po/evolution-2.2.pot']
640+ 'po', 'po/evolution-2.2.pot']
641
642 The *-es.po file is indeed the Spanish translation...
643
644
645=== modified file 'lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt'
646--- lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt 2010-01-19 12:35:33 +0000
647+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt 2010-04-27 20:46:29 +0000
648@@ -79,10 +79,14 @@
649 True
650 >>> 'empty.po' in anon_browser.contents
651 False
652- >>> 'directory.po/' in tarball.getnames()
653+
654+ # XXX: 2010-04-26, Salgado, bug=570244: Need this hack to make it pass on
655+ # python2.5 (where tarball.getnames() include a trailing slash on
656+ # directory names) and python2.6 (where directory names don't get a
657+ # trailing slash).
658+ >>> ('directory.po' in tarball.getnames()
659+ ... or 'directory.po/' in tarball.getnames())
660 True
661- >>> 'directory.po/' in anon_browser.contents
662- False
663 >>> 'directory.po' in anon_browser.contents
664 False
665 >>> 'directory.po/.another-dotfile.po' in tarball.getnames()
666
667=== modified file 'lib/lp/translations/utilities/doc/gettext_mo_exporter.txt'
668--- lib/lp/translations/utilities/doc/gettext_mo_exporter.txt 2009-07-02 17:16:50 +0000
669+++ lib/lp/translations/utilities/doc/gettext_mo_exporter.txt 2010-04-27 20:46:29 +0000
670@@ -79,12 +79,14 @@
671 ... lines = len(tarfile.extractfile(member).readlines())
672 ... else:
673 ... lines = 0
674- ... print "| %5d | %s" % (lines, member.name)
675- | 0 | es/
676- | 0 | es/LC_MESSAGES/
677+ ... # XXX: 2010-04-26, Salgado, bug=570244: The .rstrip('/') is to
678+ ... # make this pass on python2.5 and 2.6.
679+ ... print "| %5d | %s" % (lines, member.name.rstrip('/'))
680+ | 0 | es
681+ | 0 | es/LC_MESSAGES
682 | 12 | es/LC_MESSAGES/foo.mo
683- | 0 | sr/
684- | 0 | sr/LC_MESSAGES/
685+ | 0 | sr
686+ | 0 | sr/LC_MESSAGES
687 | 12 | sr/LC_MESSAGES/foo.mo
688
689
690
691=== modified file 'lib/lp/translations/utilities/doc/launchpad_write_tarfile.txt'
692--- lib/lp/translations/utilities/doc/launchpad_write_tarfile.txt 2009-07-01 20:45:39 +0000
693+++ lib/lp/translations/utilities/doc/launchpad_write_tarfile.txt 2010-04-27 20:46:29 +0000
694@@ -20,6 +20,9 @@
695 ... for name in names:
696 ... file = tarfile.extractfile(name)
697 ...
698+ ... # XXX: 2010-04-26, Salgado, bug=570244: This is to make the
699+ ... # test pass on python2.5 and 2.6.
700+ ... name = name.rstrip('/')
701 ... if file is not None:
702 ... print format % (name, file.read())
703 ... else:
704@@ -96,9 +99,9 @@
705 ... 'uno/dos/tres/cuatro': 'blah'
706 ... })
707 >>> examine_tarfile(archive)
708- uno/ |
709- uno/dos/ |
710- uno/dos/tres/ |
711+ uno |
712+ uno/dos |
713+ uno/dos/tres |
714 uno/dos/tres/cuatro | blah
715
716 Also, if there is a duplicated file, last one is the one that remains there.