Repository navigation
Open
Labels
docsDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
Description
| BPO | 18262 |
|---|---|
| Nosy | @Yhg1s, @ronaldoussoren, @serhiy-storchaka, @scrool |
| Superseder | |
| Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/serhiy-storchaka'
closed_at = None
created_at = <Date 2013-06-19.06:19:22.196>
labels = ['type-feature', 'library', 'docs']
title = 'ZipInfo.external_attr are not documented'
updated_at = <Date 2020-05-17.14:25:40.155>
user = 'https://bugs.python.org/techtonik'bugs.python.org fields:
activity = <Date 2020-05-17.14:25:40.155>
actor = 'scrool'
assignee = 'serhiy.storchaka'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Library (Lib)']
creation = <Date 2013-06-19.06:19:22.196>
creator = 'techtonik'
dependencies = []
files = ['34858', '34859']
hgrepos = []
issue_num = 18262
keywords = ['patch']
message_count = 10.0
messages = ['191447', '191451', '191456', '191457', '191458', '191488', '216246', '216247', '241314', '369122']
nosy_count = 8.0
nosy_names = ['twouters', 'ronaldoussoren', 'alanmcintyre', 'techtonik', 'docs@python', 'serhiy.storchaka', 'Alex.LordThorsen', 'scrool']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = '15795'
type = 'enhancement'
url = 'https://bugs.python.org/issue18262'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
Projects
- StatusShow more project fieldsNo status
Activity
techtonik commentedon Jun 19, 2013
zipfile doesn't restore file attributes when extracting. Documentation should at least contain example how to do this manually, because the ony way to do this - through ZipInfo.external_attr is too cryptic.
techtonik commentedon Jun 19, 2013
Here is the doc -
http://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/6297838#6297838
ronaldoussoren commentedon Jun 19, 2013
I'd be +1 on extending the zipfile API in 3.4 (with a documentation update in older releases as suggested by anatoly):
Add a method or property to ZipInfo for (un)packing
the external_attr field
Add an keyword argument to Zipfile.extract and Zipfile.extractall that
toggles restoring file permissions. This should be off by default for
backward compatibility.
The code that restores the file permissions should be careful to avoid
security problems, IMHO it should by default ignore the SUID en SGID
bits.
ronaldoussoren commentedon Jun 19, 2013
See also bpo-15795
ronaldoussoren commentedon Jun 19, 2013
Closing this as a duplicate of bpo-15795 (which already has a patch)
techtonik commentedon Jun 19, 2013
3.4+ feature is not a replacement for proper documentation for 2.7-3.4
AlexLordThorsen commentedon Apr 14, 2014
Here's a documentation patch for 2.7 that informs the users that Zipfile.extra and Zipfile.extraall don't save permissions and that Zipfile.writestr will use ZipInfo.extra_attr or default to chmod permission set of 0600.
AlexLordThorsen commentedon Apr 14, 2014
And here's the 3.4 and 3.5 patch
AlexLordThorsen commentedon Apr 17, 2015
Any follow up on this?
scrool commentedon May 17, 2020
I'm interested in this documentation enhancement as well.
Alex, I'm wondering if you could convert your patch to GitHub? [1]
[1] https://devguide.python.org/pullrequest/#converting-an-existing-patch-from-b-p-o-to-github