Message135396
zipfile.ZipFile takes a file arg that can be a 'path to a file (a string) or a file-like object'. The .write() method takes a filename arg. I would think that the proposal should be what the title says, to expand that to a file arg, either a path or 'file', as with ZipFile itself. I cannot think of any reason not to do that.
The patch adds a separate .writefp method with the file and arcname switched and the compression_type omitted. The code is mostly a duplicated subset of .write. While is proves the concept, none of the differences strike me as good. I think instead there should just be one method that branches, where appropriate, on the type of 'file', just as ZipFile.__init__ does. I admit that I do not understand what .write is supposed to do or does do when filename is a directory.
The patch includes a test. It still needs doc and News patches, but those come after the basic patch is done. |
|
Date |
User |
Action |
Args |
2011-05-07 01:20:41 | terry.reedy | set | recipients:
+ terry.reedy, alanmcintyre, proppy |
2011-05-07 01:20:40 | terry.reedy | set | messageid: <1304731240.92.0.112266737226.issue11980@psf.upfronthosting.co.za> |
2011-05-07 01:20:39 | terry.reedy | link | issue11980 messages |
2011-05-07 01:20:38 | terry.reedy | create | |
|