Merge lp:~jelmer/bzr-builddeb/712180-zipfile-python2.6 into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~jelmer/bzr-builddeb/712180-zipfile-python2.6
Merge into: lp:bzr-builddeb
Diff against target: 23 lines (+6/-0)
1 file modified
tests/test_upstream.py (+6/-0)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/712180-zipfile-python2.6
Reviewer Review Type Date Requested Status
Vincent Ladeuil Disapprove
Bzr-builddeb-hackers Pending
Review via email: mp+48445@code.launchpad.net

Description of the change

Fix zipfile tests on Python2.6. It doesn't like empty files, so add one.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

https://code.launchpad.net/~vila/bzr-builddeb/test-failures/+merge/48484 use a simpler version

I checked zipfile.writestr for python2.[456], three different versions all accepting the simpler one proposed above but varying slightly implementing yours.

As said on IRC, I'll steal the bug ;)

review: Disapprove

Unmerged revisions

508. By Jelmer Vernooij

Fix the use of zipfile in tests on python2.6.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/test_upstream.py'
--- tests/test_upstream.py 2011-02-02 13:18:56 +0000
+++ tests/test_upstream.py 2011-02-03 10:35:11 +0000
@@ -25,6 +25,7 @@
2525
26import os26import os
27import tarfile27import tarfile
28import time
28import zipfile29import zipfile
2930
30from bzrlib.tests import (31from bzrlib.tests import (
@@ -354,6 +355,11 @@
354355
355 def test_fetch_tarball_repack(self):356 def test_fetch_tarball_repack(self):
356 zf = zipfile.ZipFile("bla-2.0.zip", "w")357 zf = zipfile.ZipFile("bla-2.0.zip", "w")
358 now = time.localtime(time.time())[:6]
359 info = zipfile.ZipInfo("lolwat")
360 info.date_time = now
361 info.compress_type = zipfile.ZIP_DEFLATED
362 zf.writestr(info, "miau")
357 zf.close()363 zf.close()
358 source = TarfileSource("bla-2.0.zip", "2.0")364 source = TarfileSource("bla-2.0.zip", "2.0")
359 os.mkdir("bar")365 os.mkdir("bar")

Subscribers

People subscribed via source and target branches