Skip to content

Commit 4bcef2b

Browse files
authored
bpo-44388: Update venv EnvBuilder.ensure_directories() docs. (GH-26663)
Ref: This changes the documentation for `EnvBuilder.ensure_directories(env_dir)` to match the actual behavior of that API call. In particular, `ensure_directories()` is not affected by the state of the `upgrade` attribute, and will not cause an error to have existing directories whether or not the `clear` attribute is set. This documentation change I believe should be valid to all python versions back to 3.6. Automerge-Triggered-By: GH:vsajip
1 parent ec8759b commit 4bcef2b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/library/venv.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ creation according to their needs, the :class:`EnvBuilder` class.
170170

171171
.. method:: ensure_directories(env_dir)
172172

173-
Creates the environment directory and all necessary directories, and
174-
returns a context object. This is just a holder for attributes (such as
175-
paths), for use by the other methods. The directories are allowed to
176-
exist already, as long as either ``clear`` or ``upgrade`` were
177-
specified to allow operating on an existing environment directory.
173+
Creates the environment directory and all necessary subdirectories that
174+
don't already exist, and returns a context object. This context object
175+
is just a holder for attributes (such as paths) for use by the other
176+
methods. If the :class:`EnvBuilder` is created with the arg
177+
``clear=True``, contents of the environment directory will be cleared
178+
and then all necessary subdirectories will be recreated.
178179

179180
.. method:: create_configuration(context)
180181

0 commit comments

Comments
 (0)