msg294756 - (view) |
Author: Alex Gaynor (Alex Gaynor) |
Date: 2017-05-30 13:46 |
Currently shutil.make_archive uses os.chdir, however there's no need for that. Everything that's done could be equally accomplished with path manipulation: https://github.com/python/cpython/blob/master/Lib/shutil.py#L773-L779 We should switch to using path manipulation in order to make shutil.make_archive thread safe. (Flag: This is probably a good bug for someone with Python skills interested in contributing to CPython!) |
|
|
msg294758 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2017-05-30 14:13 |
Unfortunately this is not possible. The signature of functions registered with register_archive_format() doesn't support this. |
|
|
msg294759 - (view) |
Author: Alex Gaynor (Alex Gaynor) |
Date: 2017-05-30 14:13 |
None of those functions are a public API, so changing them shouldn't be a problem IMO. |
|
|
msg294760 - (view) |
Author: Alex Gaynor (Alex Gaynor) |
Date: 2017-05-30 14:14 |
Ugh, except via |register_archive_format |
. |
register_archive_format |
msg297902 - (view) |
Author: Joey Harrington (Joey Harrington) |
Date: 2017-07-07 18:55 |
It would be nice if there was at least a warning in the docs that make_archive is not thread-safe, and that if you have two threads creating archives that it's extremely likely you'll get erroneous results since the race condition lasts for the entire duration of the archive creation. |
|
|
msg389849 - (view) |
Author: Michael Osipov (michael-o) * |
Date: 2021-03-30 20:09 |
Just wasted two hours for this. Can someone really update the documentation of it if this is not going to change. |
|
|
msg396633 - (view) |
Author: Andrei Kulakov (andrei.avk) *  |
Date: 2021-06-28 13:14 |
PR is added here: https://github.com/python/cpython/pull/26933 |
|
|
msg397928 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2021-07-21 08:33 |
New changeset 64f54b7ccd49764b0304e076bfd79b5482988f53 by andrei kulakov in branch 'main': bpo-30511: Add note on thread safety to shutil.make_archive() (#26933) https://github.com/python/cpython/commit/64f54b7ccd49764b0304e076bfd79b5482988f53 |
|
|
msg397932 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2021-07-21 08:55 |
New changeset d17449f31d4af7a735e81b587bb329481764412f by Miss Islington (bot) in branch '3.10': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27274) https://github.com/python/cpython/commit/d17449f31d4af7a735e81b587bb329481764412f |
|
|
msg397934 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2021-07-21 09:04 |
New changeset c8e35abfe304eb052a5220974006072c37d4b06a by Miss Islington (bot) in branch '3.9': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27275) https://github.com/python/cpython/commit/c8e35abfe304eb052a5220974006072c37d4b06a |
|
|
msg397935 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2021-07-21 09:04 |
New changeset 54d387105a5f0c3825a0f4fa607b58d55d05e572 by Miss Islington (bot) in branch '3.8': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (#27276) https://github.com/python/cpython/commit/54d387105a5f0c3825a0f4fa607b58d55d05e572 |
|
|