This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年05月12日 09:36 by ronaldoussoren, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| zipfile_writestr.patch | ronaldoussoren, 2009年05月19日 20:14 | |||
| Messages (8) | |||
|---|---|---|---|
| msg87610 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2009年05月12日 09:36 | |
Class zipfile.ZipFile has two methods for adding data to a zipfile: 'write' and 'writestr'. The former has a "compression_type" argument that can be used to specify the compression to be used. That latter doesn't have that argument. Could a "compression_type" argument be added to "writestr" as well? I regularly create zipfiles from scratch using the writestr method to add content and currently have to modify the 'compression' attribute of the zipfile object to control compression and that leads to ugly code. The other alternative is to use a ZipInfo object as the archive-name of the newly added file, but that leads to even uglier code. |
|||
| msg87625 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年05月12日 13:24 | |
This sounds like a good idea. Can you provide a patch (including tests)? |
|||
| msg87627 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2009年05月12日 13:30 | |
I will. I guess it's too late to merge this into 3.1 (as the first beta has already been released). |
|||
| msg87629 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年05月12日 13:33 | |
> I guess it's too late to merge this into 3.1 (as the first beta has > already been released). Since the change should be small and uncontroversial, I think it could go in. Benjamin has the final word. |
|||
| msg88096 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2009年05月19日 20:14 | |
The attached patch implements my proposal, including documentation and tests. I'm not 100% happy about the tests, they may be a bit too minimal. |
|||
| msg88097 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2009年05月19日 20:15 | |
Argh... The patch includes an update to configure.in, please ignore that bit. |
|||
| msg88437 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年05月27日 19:53 | |
The patch looks ok. It can certainly go in trunk, as for 3.1 it's up to Benjamin to decide. Note: the docs should state that the new argument appeared in 2.7. |
|||
| msg99015 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年02月07日 20:24 | |
Committed in r78097 (trunk) and r78098 (3.2). This includes the documentation change suggested in msg88437 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:48 | admin | set | github: 50253 |
| 2010年02月07日 20:24:58 | ronaldoussoren | set | status: open -> closed resolution: fixed messages: + msg99015 stage: needs patch -> resolved |
| 2009年05月27日 19:53:21 | pitrou | set | messages: + msg88437 |
| 2009年05月19日 20:15:29 | ronaldoussoren | set | messages: + msg88097 |
| 2009年05月19日 20:14:25 | ronaldoussoren | set | files:
+ zipfile_writestr.patch keywords: + patch messages: + msg88096 |
| 2009年05月12日 13:33:22 | pitrou | set | nosy:
+ benjamin.peterson messages: + msg87629 |
| 2009年05月12日 13:30:14 | ronaldoussoren | set | messages: + msg87627 |
| 2009年05月12日 13:24:27 | pitrou | set | priority: normal nosy: + pitrou messages: + msg87625 assignee: ronaldoussoren components: + Library (Lib) |
| 2009年05月12日 09:36:45 | ronaldoussoren | create | |