[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo

Éric Araujo  added the comment:

On second thought, maybe no fix should be backported.
Changing behaviour silently might break things, changing with a new option puts 
the change in a grey fix/enhancement area, so maybe better to let current 
versions as they are, with the bug/limitation noted in the documentation, and 
give control in 3.11 only.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Sam Ezeh


Sam Ezeh  added the comment:

I don't know what the best course of action would be but if preserving 
permissions needs to be back-ported, could the default permission preservation 
flag in 3.11+ be the one to preserve safe permissions and then make it so that 
the previous versions (<3.11, without the constants) always take this course of 
action? Maintaining the different options for preserving permissions while 
still allowing for this functionality to be back-ported.

I don't have a strong opinion on backporting permission preservation but to me, 
it seems like it would be a change in behaviour instead of a bug fix. The 
current default in the PR is to not preserve any permissions but if necessary, 
I'll change it to whatever is agreed upon.

I'll move the constants into an enum, but right now I'm not sure how I'd name 
the class.

As an aside, while writing this comment I realised that the reason tests aren't 
passing on my end might very well be due to the fact I do CPython work on an 
NTFS partition instead of on my main EXT4 partition.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo

Change by Éric Araujo :


--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo

Éric Araujo  added the comment:

The new PR uses new constants*, so could not be backported as is (see my 
previous message).


(*side question: should the constants use an enum?)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-03 Thread Sam Ezeh


Change by Sam Ezeh :


--
pull_requests: +30350
pull_request: https://github.com/python/cpython/pull/32289

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-03 Thread Sam Ezeh


Change by Sam Ezeh :


--
nosy: +sam_ezeh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2021-10-25 Thread Selim Belhaouane


Change by Selim Belhaouane :


--
nosy: +selimb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2021-10-23 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I left a review on the PR requesting for some tests, if it makes sense.

--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2021-05-31 Thread Éric Araujo

Éric Araujo  added the comment:

The pull request needs unit tests added to validate the changes.

Note that the patch attached here was a new feature, adding constants and 
parameters to control the behaviour, but the PR simply checks and applies 
permissions bits stored in the entry.  That seems correct and nice to me, and 
arguably a bugfix that should be backported, but more active core devs and/or 
zipfile experts should weigh in.

--
nosy: +eric.araujo
versions: +Python 3.10 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2021-04-14 Thread William Woodruff


Change by William Woodruff :


--
nosy: +yossarian

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2020-10-16 Thread Nikolay


Nikolay  added the comment:

Is there any chance that the pull request will be accepted? I'm a bit tired of 
using workaround every time I need unzip something on linux.

--
nosy: +kulakov-n

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2020-01-01 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +17223
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17790

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread ABR

Change by ABR :


--
nosy:  -arobert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread Étienne Dupuis

Étienne Dupuis  added the comment:

A workaround is provided here: 
https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries

--
nosy: +Étienne Dupuis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2016-12-23 Thread Karen Tracey

Karen Tracey added the comment:

Note the zipfile being processed may have been created on a non-Unix system, 
and the external_attr value can't be usefully interpreted as permission bits 
when the value at _CD_CREATE_SYSTEM 
(https://hg.python.org/cpython/file/default/Lib/zipfile.py#l107) in the central 
directory entry is not Unix (3). Patches so far don't seem to guard against 
mistakenly assuming a foreign-system external_attr value can be interpreted as 
Unix permission bits.

(At present github is delivering zipfiles of repos with a create system value 
of 0 and external_attr values of 0.)

--
nosy: +kmtracey

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2016-03-02 Thread Mark Mikofski

Mark Mikofski added the comment:

same problem in 2.7.5 on Oracle Linux 7.2

--
nosy: +bwanamarko

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2015-03-03 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: commit review - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2015-03-03 Thread Alexey Boriskin

Alexey Boriskin added the comment:

I'm working on updating the patch to unify tarfile and zipfile interfaces and 
to restore owner/timestamp for zipfile

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2015-02-07 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
nosy: +belopolsky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2015-01-05 Thread ABR

ABR added the comment:

I hope this can be finally gotten in for 3.5, even if it's not the perfect 
solution.  I hit this issue and needed to call out to a subprocess as a 
work-around, but that's far less reliable.

--
nosy: +arobert

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2015-01-05 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The TarFile.extract() method has the set_attrs parameter which controls similar 
behavior but is less flexible. It would be good to unify zipfile and tarfile 
abilities. set_attrs also controls setting file owner and time. When we restore 
unsafe uid/gid/sticky bits, it would be worth to restore also file owner. And 
it would be not bad to restore file time.

--
assignee:  - serhiy.storchaka
nosy: +lars.gustaebel, serhiy.storchaka
versions: +Python 3.5 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-06-15 Thread William Ehlhardt

Changes by William Ehlhardt williamehlha...@gmail.com:


--
nosy: +Orborde

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-06-13 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Glenn Jones

Glenn Jones added the comment:

Patch cleaned up based on previous comments.

--
Added file: http://bugs.python.org/file34873/issue15795_cleaned.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. I added a couple of comments to your latest patch.

--
nosy: +Claudiu.Popa

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Glenn Jones

Glenn Jones added the comment:

Patch with docs and tests fixed

--
Added file: http://bugs.python.org/file34893/issue15795_test_and_doc_fixes.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-14 Thread Glenn Jones

Glenn Jones added the comment:

Here is an updated patch that applies cleanly to head. Tests pass against head 
of repo.

--
nosy: +Glenn.Jones
Added file: http://bugs.python.org/file34852/issue15795_updated.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

Thanks.

The patch contains a number of lines that are not wrapped to 80, which is one 
of our requirements.  It would be great to get that fixed.  (In the 
documentation, you can use \ to wrap the prototype line.)

There is non-ascii in one place in the documentation...probably an em-dash, 
which is written in sphinx as '---'.

Also, please remove the news entry from the patch, it will just make it harder 
to apply (and is in the wrong place anyway...we add entries at the top of the 
appropriate section, not the bottom).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-19 Thread Ronald Oussoren

Ronald Oussoren added the comment:

On first glance the patch looks good. I haven't tested it with the current 
trunk though.

--
nosy: +ronaldoussoren

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-18 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
nosy: +techtonik

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-18 Thread anatoly techtonik

anatoly techtonik added the comment:

There should be an easy way to restore file attributes.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2013-03-01 Thread Cédric de Saint Martin

Changes by Cédric de Saint Martin ced...@desaintmartin.fr:


--
nosy: +desaintmartin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-10-31 Thread Aaron Train

Aaron Train added the comment:

Thanks for the patch. Is this going to be resolved soon?

--
nosy: +Aaron.Train

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-10-31 Thread R. David Murray

R. David Murray added the comment:

OK, so this is an enhancement to specifically allow preservation of unsafe 
permissions?

Adding the nosy list from issue 3394.

--
nosy: +cbrannon, pitrou, swarren
type: behavior - enhancement
versions:  -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread Alexey Boriskin

Changes by Alexey Boriskin sun.v...@gmail.com:


--
hgrepos: +147

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
hgrepos:  -147

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread Alexey Boriskin

Alexey Boriskin added the comment:

I'm attaching a patch, which solves the issue. Patch intoduces new argument 
preserve_permissions for extract and extractall methods. That argument may 
accept one of the three values: do not preserve permissions, preserve a safe 
subset of them or preserve all permissions. Three constants introduced for 
these options. Patch also contains test and docs. Tests pass for me on OS X 
10.5, but I'm not sure if they'll pass on other operating systems.

--
keywords: +patch
Added file: http://bugs.python.org/file27086/issue15795.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-08-27 Thread Alexey Boriskin

New submission from Alexey Boriskin:

Zipfile._extract_member does not preserve file permissions while extracting it. 
As may be seen at link[1], raw open() is used and no os.chmod() applied after 
that, therefore any permission data stored in zipfile is dropped and file is 
created with default permission depending on current user's umask.

[1] http://hg.python.org/cpython/file/52159aa5d401/Lib/zipfile.py#l1251

--
components: Library (Lib)
messages: 169233
nosy: uruz
priority: normal
severity: normal
status: open
title: Zipfile.extractall does not preserve file permissions
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15795] Zipfile.extractall does not preserve file permissions

2012-08-27 Thread R. David Murray

R. David Murray added the comment:

Does this have any relationship to issue 3394?  From the discussion on that 
issue it sounds like zipfile is doing things with external_attributes if it is 
set.  But I don't know much about zipfile internals.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com