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
1=== modified file 'tests/test_upstream.py'
2--- tests/test_upstream.py 2011-02-02 13:18:56 +0000
3+++ tests/test_upstream.py 2011-02-03 10:35:11 +0000
4@@ -25,6 +25,7 @@
5
6 import os
7 import tarfile
8+import time
9 import zipfile
10
11 from bzrlib.tests import (
12@@ -354,6 +355,11 @@
13
14 def test_fetch_tarball_repack(self):
15 zf = zipfile.ZipFile("bla-2.0.zip", "w")
16+ now = time.localtime(time.time())[:6]
17+ info = zipfile.ZipInfo("lolwat")
18+ info.date_time = now
19+ info.compress_type = zipfile.ZIP_DEFLATED
20+ zf.writestr(info, "miau")
21 zf.close()
22 source = TarfileSource("bla-2.0.zip", "2.0")
23 os.mkdir("bar")

Subscribers

People subscribed via source and target branches