From 1861faf56730e0db085b579f8f07377de720c7d6 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 1 Oct 2021 14:23:32 +0000 Subject: [PATCH] More exact section matching for tox showconfig With the original verbose output support in change Iafeb88eaf9a596603ad4d2134a4574345d5189ab we looked for lines from tox --showconfig output starting with an opening '[' but verbosity also causes output from pip install activity to be included if a tox.requires entry causes it to install packages before continuing and these lines are prefixed by a process ID number wrapped in brackets with the command string after that, which prematurely triggered our search for the start of the INI content. Add a stipulation that the first INI output line also end in ']' in order to skip over those additional prepended lines. Change-Id: If29e5a9abe3b92a145d87f5efc1b93350ea3908a --- roles/tox/library/tox_install_sibling_packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/tox/library/tox_install_sibling_packages.py b/roles/tox/library/tox_install_sibling_packages.py index ed5256532..05e378fb2 100644 --- a/roles/tox/library/tox_install_sibling_packages.py +++ b/roles/tox/library/tox_install_sibling_packages.py @@ -319,7 +319,7 @@ def main(): if not discard: # Normal operation, tested first for efficiency tox_clean_config += line - elif line.startswith('['): + elif line.startswith('[') and line.rstrip().endswith(']'): # Once we see a section heading, stop discarding discard = False tox_clean_config += line