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 2011年03月06日 18:24 by piranna, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg130182 - (view) | Author: Jesús Leganés Combarro (piranna) | Date: 2011年03月06日 18:24 | |
I've created a new, compresed ZipFile in memory (using StringIO) and added several files to it with ZipFile.write(), later i've added a new file with the same name of one of the previous ones just to overwrite it with some dinamic data using ZipFile.writestr(), and finally i've closed the StringIO ZipFile and writen to the hard disk. Secondly, i've opened it with FileRoller and found that the overwritten file is twice inside the ZipFile, the first and the second one, with different sizes and timestamp. Luckily, extracting one of them just get only the more recent one, but the fact is that the old one is already there and it's listed instead being overwritten with the last, new one, and i don't know if it's a bug (i think so) or just a feature. |
|||
| msg130254 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2011年03月07日 12:46 | |
> Luckily, extracting one of them just get only the more recent one It's not only luck: a Zip file has a "central directory" used to retrieve data. ZipFile just appends the new file data to the end of the Zip file, then write the updated directory structure. Removing the old content is another matter, and is similar to issue6818. This requires a whole copy of the zip file, and so far, no acceptable patch was proposed. |
|||
| msg130255 - (view) | Author: Jesús Leganés Combarro (piranna) | Date: 2011年03月07日 13:13 | |
Ok, they talk about remove it, that's why i didn't found it :-P Ok, it make sense. By the way, this way the old data is available? How? (Just to know... it could be a courious feature :-D ) |
|||
| msg131388 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2011年03月19日 05:07 | |
2.6 is only open for security fixes. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:14 | admin | set | github: 55624 |
| 2011年03月19日 05:07:47 | terry.reedy | set | status: open -> closed superseder: remove/delete method for zipfile/tarfile objects versions: - Python 2.6 nosy: + terry.reedy messages: + msg131388 resolution: not a bug |
| 2011年03月07日 13:13:09 | piranna | set | messages: + msg130255 |
| 2011年03月07日 12:46:17 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg130254 |
| 2011年03月06日 18:24:12 | piranna | create | |