Commit 387d0e53 authored by Jason R. Coombs's avatar Jason R. Coombs

Restrict use of os.makedirs to those with the security patch introduced in...

Restrict use of os.makedirs to those with the security patch introduced in Python 3.2.6, 3.3.5, and 3.4.1 per https://bugs.python.org/issue21082. Ref #1082.
parent dd622e26
......@@ -3,9 +3,6 @@ import errno
import sys
PY32 = sys.version_info >= (3, 2)
def _makedirs_31(path, exist_ok=False):
try:
os.makedirs(path)
......@@ -14,4 +11,12 @@ def _makedirs_31(path, exist_ok=False):
raise
makedirs = os.makedirs if PY32 else _makedirs_31
# rely on compatibility behavior until mode considerations
# and exists_ok considerations are disentangled.
# See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663
needs_makedirs = (
sys.version_info <= (3, 2, 6) or
(3, 3) <= sys.version_info <= (3, 3, 5) or
(3, 4) <= sys.version_info <= (3, 4, 1)
)
makedirs = os.makedirs if needs_makedirs else _makedirs_31
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment