Sam Thursfield added the comment:
Here's a patch which does the same thing but only for shutil.make_archive().
Note that the final output will still be non-deterministic if you use
format=gztar because time.time() and the base_name argument get added to the
gzip header. Might be nice t
Sam Thursfield added the comment:
Having tested, the problem I described above doesn't happen with this patch.
It's a mistake in some other code I wrote which is following symlinks when it
should not do.
--
___
Python trac
Sam Thursfield added the comment:
I've discovered that this patch introduces a nasty failure case! If you have a
relative symlink pointing to a directory that's alphabetically sorted after the
symlink, and files inside the symlink, 'tar -x' won't be able to create
Sam Thursfield added the comment:
Thanks for the comments! Would you be happy for the patch to be merged if it
was implemented by modifying shutil.make_archive() instead? I will rework it if
so.
--
___
Python tracker
<http://bugs.python.
Changes by Sam Thursfield :
--
keywords: +patch
Added file: http://bugs.python.org/file39728/tarfile-stable-ordering.patch
___
Python tracker
<http://bugs.python.org/issue24
New submission from Sam Thursfield:
I want shutil.make_archive() to produce deterministic output when given
identical data as inputs.
Right now there are two holes in this. One is that mtimes might not match. This
can be fixed by the caller. The second is that the order that files in a
Sam Thursfield added the comment:
sorry, replace 'open' with 'bltn_open' in the above comment - no need to change
it.
--
___
Python tracker
<http://bug
New submission from Sam Thursfield:
Exceptions such as disk full during extraction cause tarfile to leak file
handles. Besides being messy, it causes real problems if, for example, the
target file is on a mount that should be unmounted before the program exits -
in this case, the unmount will