From d5bac02a38e5158b3d304ea33cf54f2c2d46d315 Mon Sep 17 00:00:00 2001 From: nathansilberman Date: Sun, 29 Mar 2020 13:02:02 -0400 Subject: [PATCH 1/2] Ensuring that existing directories can be created if they already exist. --- Lib/zipfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index c3f814cc747e06..c9c186ff0fae3e 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1677,11 +1677,11 @@ def _extract_member(self, member, targetpath, pwd): # Create all upper directories if necessary. upperdirs = os.path.dirname(targetpath) if upperdirs and not os.path.exists(upperdirs): - os.makedirs(upperdirs) + os.makedirs(upperdirs, exist_ok=True) if member.is_dir(): if not os.path.isdir(targetpath): - os.mkdir(targetpath) + os.makedirs(targetpath, exist_ok=True) return targetpath with self.open(member, pwd=pwd) as source, \ From cdc42afda5424b2efdfe1c392a45956589bcb6cd Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2020 13:51:25 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-04-20-13-51-24.bpo-40103.7e8Bld.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-04-20-13-51-24.bpo-40103.7e8Bld.rst diff --git a/Misc/NEWS.d/next/Library/2020-04-20-13-51-24.bpo-40103.7e8Bld.rst b/Misc/NEWS.d/next/Library/2020-04-20-13-51-24.bpo-40103.7e8Bld.rst new file mode 100644 index 00000000000000..5e5ff0f2293a18 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-13-51-24.bpo-40103.7e8Bld.rst @@ -0,0 +1 @@ +Ensuring that Python can unzip into the same directories from multiple processes at the same time. \ No newline at end of file