Xavier de Gaye <xdeg...@gmail.com> added the comment:

extract_from_pkgs() in the attached extract_from_packages.py script extracts 
/etc files from the tar files in PKG_DIR into WORK_DIR using a 
ThreadPoolExecutor (a ThreadPoolExecutor, when used to extract all the /etc 
files from the packages that build a whole ArchLinux system, divides the 
elapsed time by 2). Running this script that tests this function fails randomly 
with the same error as reported by Srdjan in msg237961.

Replacing ThreadPoolExecutor with ProcessPoolExecutor also fails randomly.

Using the safe_makedirs() context manager to enclose the statements than run 
ThreadPoolExecutor fixes the problem.

Obviously this in not a problem related to thread-safety (it occurs also with 
ProcessPoolExecutor) but a problem about the robustness of the tarfile module 
in a concurrent access context. The problem is insidious in that it may never 
occur in an application test suite.

----------
nosy: +xdegaye
Added file: https://bugs.python.org/file47523/extract_from_packages.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue23649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to