[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: The whole lib still needs the threading locks added but the patch submitted should fix things for people that do the locking from their code. -- ___ Python tracker <http://bugs.python.org/issue23

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: Patch for the multithreaded expansion of files and use of makedirs. -- keywords: +patch Added file: http://bugs.python.org/file38462/mutithreading_tarfile.patch ___ Python tracker <http://bugs.python.org/issue23

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: After some thinking, for the makedirs it should only need makedirs(exist_ok=True) -- ___ Python tracker <http://bugs.python.org/issue23

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: I don't know if that's true of core libraries. Why complicate things for end users when those issues could be done in the library itself and be completely transparent to the devs? A simple RLock latch wouldn't pose almost any speed degradation

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: The code around tarfile multi-threading was fixed for me on the user-side with threading.Lock() usage so it might work to use this within the library and the directory creation could be improved by probably doing a try/except around the makedirs() call with

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Changes by Srdjan Grubor : -- type: enhancement -> behavior ___ Python tracker <http://bugs.python.org/issue23649> ___ ___ Python-bugs-list mailing list Un

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Srdjan Grubor added the comment: Also, extract_member in tarfile.py is not thread-safe since the check for folder existence might occur during another thread's creation of that same dir causing the code to error out. File "/usr/lib/python3.4/concurrent/futures/thread.py",

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
Changes by Srdjan Grubor : -- type: behavior -> enhancement ___ Python tracker <http://bugs.python.org/issue23649> ___ ___ Python-bugs-list mailing list Un

[issue23649] tarfile not re-entrant for multi-threading

2015-03-12 Thread Srdjan Grubor
New submission from Srdjan Grubor: When running tarfile.extract through multiple threads, the archive reading pointer is not protected from simultaneous seeks and causes various convoluted bugs: self.archive_object.extract(member, extraction_path) File "/usr/lib/python3.4/tarfi