Replace the nondetermistic default locale_dir kwarg with fixed value for reproducibility #11037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Whilst working on the Reproducible Builds effort I noticed that sphinx could not be built reproducibly.
This is because the
locale_dirkeyword argument for theinit_consolemethod defaults to the path that method is implemented in (using Python's__file__mechanism), and then that (non-deterministic) default argument is included in Sphinx's own documentation. This makes the build unreproducible as it varies depending on the directory you create the documentation from.This patch uses the typical
fn(arg1=None) […] if arg1 is None: arg1=defaultvalpattern to avoid this, and was first submitted by me to Debian in bug #1025801.