On 1/22/2010 3:19 PM, Tarek Ziadé wrote:
[..]
>  How about having an extra argument that would fix the permission? (Fixing
>  the permission is only applicable for tarfile, not zipfile, hence even our
>  callable will become specific to tarfile).
>
>    >>>  shutil.unpack_archive("/tmp/foo.tgz", "/tmp", make_readable=True)
>    >>>  help(shutil.unpack_archive)
>    [...]
>    If `make_readable` is True, then files with limited permission (cannot
>    be read) will be fixed to make them readable by the current user.
That's still the same specific use case. Out of curiosity, how many
archives have you had the
problem with ?

If like I think, this is quite rare, I am -1 to introduce it that way
because you could handle with a generic callable as mentioned.

Yes, it is quite rare (I can recall maybe 2-4 packages having this problem). I see what you mean now. Since it is not a popular issue, adding this to stdlib may not be a good idea.

On 1/22/2010 2:44 PM, Tarek Ziadé wrote:
> Now, for shutil.unpack_archive, we could add a callable option (like
> the progress_filter one)
> that would be called with each newly extracted file, so one may apply
> any process on it.

Will this callable recieve TarInfo objects if the filetype is tarfile? What would it receive otherwise? How can `_ensure_read_write_access` be implemented using this callable? I cannot think of a design for this. (In that case, maybe then the permission setting would happen on the actual extracted files post-extraction).

-srid
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to