-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Tox 4 --showconfig/--help-ini with -v emits invalid ini content #2622
Comments
Have you considered not adding the
Perhaps, but was never supported... |
Yes, that is what we have done to work around this. It just seems odd that the command to emit ini content doesn't do that. I think there are a number of good ways to address that as I've mentioned above. |
This is not a good idea because what if we fail during the run, we still need logs to find out what went wrong.
This would be just as much a breaking change, and many tools consider stderr as failure, so would fail other CIs.
For the reporting engine, we don't have a config mode and a non-config mode, so all reports would be prefixed with a comment, which again would be a breaking change. So you see, neither of your proposals is tenable. The easiest fix is:
You've been using an unsupported behavior, and now it broke. You can't complain about it, that now you need to make changes to be in supported land. Especially considering the major release versioning behind what it was done. |
So if you want to generate a valid ini file, you must not use verbose mode. This fixes tox-dev#2622.
So if you want to generate a valid ini file, you must not use verbose mode. This fixes tox-dev#2622.
So if you want to generate a valid ini file, you must not use verbose mode. This fixes tox-dev#2622.
To be honest, I @cboylan assumption that the option that outputs an INI file is perfectly normal. The bug is that tox 4 still abuses stdout for logging purposes instead of using stderr for it. This behavior also broke one of my small mk utilities as the output is no longer valid ini, so I cannot load it. Lucky in my case adding |
Issue
Tox 4
--showconfig
/--help-ini
with-v
emits invalid ini content. Under tox 3.x this worked if you ignored the first couple of lines of output, but under v4 the extra debugging info is interleaved with the ini content making this much more difficult.I think there are a few possible options to handle this:
--showconfig
.stderr
instead ofstdout
so the output streams can be separated.This problem gets worse as you add -v flags too.
Environment
Provide at least:
pip list
of the host Python wheretox
is installed:Minimal example
If possible, provide a minimal reproducer for the issue:
cat tox.ini
tox -c tox.ini -v --showconfig
Note the ROOT: lines that originate from
-v
. Since there are multiple entries with the same prefix under[testenv:foo]
configparser complains that there are duplicates and raises an exception when parsing this content:Produces:
The text was updated successfully, but these errors were encountered: