view .hgtags @ 2168:dd4ec4576cc8

Proper check to see if zip dest needs to be wrapped in tellable From hgweb, calling archival.zipit fails with the error message "Illegal seek". This happens because sys.stdout.tell() throws an exception: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mercurial/archival.py", line 99, in addfile self.z.writestr(i, data) File "/usr/lib/python2.4/zipfile.py", line 468, in writestr zinfo.header_offset = self.fp.tell() # Start of header bytes Checking whether hasattr(dest, 'tell') is insufficient, because sys.stdout has a tell() method; you just can't call it. This patch instead determines whether a fileobj is tellable by trying to tell(), wrapping the fileobj if an exception is generated.
author Colin McMillen <mcmillen@cs.cmu.edu>
date Sun, 30 Apr 2006 22:43:41 +0200
parents c0b945c5df08
children ba7afc7dd901
line wrap: on
line source

d40cc5aacc31ed673d9b5b24f98bee78c283062c 0.4f
1c590d34bf61e2ea12c71738e5a746cd74586157 0.4e
7eca4cfa8aad5fce9a04f7d8acadcd0452e2f34e 0.4d
b4d0c3786ad3e47beacf8412157326a32b6d25a4 0.4c
f40273b0ad7b3a6d3012fd37736d0611f41ecf54 0.5
0a28dfe59f8fab54a5118c5be4f40da34a53cdb7 0.5b
12e0fdbc57a0be78f0e817fd1d170a3615cd35da 0.6
4ccf3de52989b14c3d84e1097f59e39a992e00bd 0.6b
eac9c8efcd9bd8244e72fb6821f769f450457a32 0.6c
979c049974485125e1f9357f6bbe9c1b548a64c3 0.7
3a56574f329a368d645853e0f9e09472aee62349 0.8
6a03cff2b0f5d30281e6addefe96b993582f2eac 0.8.1