From 834ab298788fe4e543f7f1af1025b23e0bc09552 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 28 Dec 2021 19:32:07 +0100 Subject: [PATCH] Make watcherclient/shell.py reproducible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, Whilst working on the Reproducible Builds effort [0] we noticed that python-watcherclient could not be built reproducibly. This is because the documentation generates automatic documentation for the "main()" entrypoint method's arguments, one of which is "sys.argv". During document generation this results in documentation examples like: def main(argv=['-b', 'html', 'doc/source', '«ABSOLUTE_BUILD_DIR»/debian/python-watcherclient-doc/usr/.../html']): … etc. Patch attached that sets "None" instead but retains the existing fallback logic. [0] https://reproducible-builds.org/ Please note that this was reported in the Debian tracker: https://bugs.debian.org/960607 and that the fix was applied to the Debian package. Change-Id: I502bb2d11d90ce4c46c14904a8c048ea824f11d5 --- watcherclient/shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/watcherclient/shell.py b/watcherclient/shell.py index 4f2e113..1885853 100644 --- a/watcherclient/shell.py +++ b/watcherclient/shell.py @@ -203,7 +203,9 @@ class WatcherShell(app.App): LOG.info("END return value: %s", ret_val) -def main(argv=sys.argv[1:]): +def main(argv=None): + if argv is None: + argv = sys.argv[1:] watcher_app = WatcherShell() return watcher_app.run(argv)