Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
925dd35e
Commit
925dd35e
authored
Jul 13, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid race condition in ensure_directory. Ref #1083.
parent
995d3093
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
CHANGES.rst
CHANGES.rst
+3
-0
pkg_resources/__init__.py
pkg_resources/__init__.py
+3
-2
pkg_resources/py31compat.py
pkg_resources/py31compat.py
+17
-0
No files found.
CHANGES.rst
View file @
925dd35e
v36
.1.0
-------
*
#
1083
:
Avoid
race
condition
on
directory
creation
in
``
pkg_resources
.
ensure_directory
``.
*
Removed
deprecation
of
and
restored
support
for
``
upload_docs
``
command
for
sites
other
than
PyPI
.
Only
warehouse
is
dropping
support
,
but
services
like
...
...
pkg_resources/__init__.py
View file @
925dd35e
...
...
@@ -67,6 +67,7 @@ try:
except
ImportError
:
importlib_machinery
=
None
from
.
import
py31compat
from
pkg_resources.extern
import
appdirs
from
pkg_resources.extern
import
packaging
__import__
(
'pkg_resources.extern.packaging.version'
)
...
...
@@ -74,6 +75,7 @@ __import__('pkg_resources.extern.packaging.specifiers')
__import__
(
'pkg_resources.extern.packaging.requirements'
)
__import__
(
'pkg_resources.extern.packaging.markers'
)
if
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
):
raise
RuntimeError
(
"Python 3.3 or later is required"
)
...
...
@@ -2958,8 +2960,7 @@ def _find_adapter(registry, ob):
def ensure_directory(path):
"""Ensure that the parent directory of `path` exists"""
dirname = os.path.dirname(path)
if not os.path.isdir(dirname):
os.makedirs(dirname)
py31compat.makedirs(dirname, exist_ok=True)
def _bypass_ensure_directory(path):
...
...
pkg_resources/py31compat.py
0 → 100644
View file @
925dd35e
import
os
import
errno
import
sys
PY32
=
sys
.
version_info
>=
(
3
,
2
)
def
_makedirs_31
(
path
,
exist_ok
=
False
):
try
:
os
.
makedirs
(
path
)
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
EEXIST
:
raise
makedirs
=
os
.
makedirs
if
PY32
else
_makedirs_31
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment