Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make util.typing.restify sanitise unreproducible output #9755

Conversation

lamby
Copy link
Contributor

@lamby lamby commented Oct 21, 2021

Whilst working on the Reproducible Builds effort I noticed that sphinx generates output that is not reproducible, causing a number of packages in Debian to unreproducible.

Specifically, when Sphinx locates an alias of an instance when generating autodoc documentation, it uses the raw Python repr(...) of the object and does not sanitise it for memory addresses (etc.) like elsewhere in Sphinx.

This can result in documentation like this:

-<dd><p>alias of &lt;webob.client.SendRequest object at 0x7fd769189df0&gt;</p>
+<dd><p>alias of &lt;webob.client.SendRequest object at 0x7f0f02233df0&gt;</p>

Patch attached that uses the object_description method, which was added to fix precisely this kind of issue.

I originally filed this in Debian as bug #996948.

…ddresses)

Whilst working on the Reproducible Builds effort [0] I noticed that sphinx
generates output that is not reproducible, causing a number of packages in
Debian to unreproducible.

Specifically, when Sphinx locates an alias of an instance when generating
'autodoc' documentation, it uses the raw Python repr(...) of the object and
does not sanitise it for memory addresses (etc.) like elsewhere in Sphinx.

This can result in documentation like this:

-<dd><p>alias of &lt;webob.client.SendRequest object at 0x7fd769189df0&gt;</p>
+<dd><p>alias of &lt;webob.client.SendRequest object at 0x7f0f02233df0&gt;</p>

Patch attached that uses the object_description method, which was added to fix
precisely this kind of issue.

I originally filed this in Debian as bug #996948 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/996948
@lamby lamby force-pushed the 996948-sphinx-please-make-the-output-of-instance-aliases-reproducible branch from 3284ca6 to ef7dfcd Compare October 21, 2021 09:41
@tk0miya tk0miya added this to the 4.3.0 milestone Oct 22, 2021
@tk0miya tk0miya merged commit 36eb4b7 into sphinx-doc:master Oct 22, 2021
@tk0miya
Copy link
Member

tk0miya commented Oct 22, 2021

Thanks!

tk0miya added a commit that referenced this pull request Oct 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants