-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
"warning: mpd_setminalloc" caused by importing toml locally (in TomlConfigParser.read()
method)
#1084
Comments
nedbat
added a commit
that referenced
this issue
Jan 18, 2021
nedbat
added a commit
that referenced
this issue
Jan 18, 2021
It was an obscure case, but I'd wanted to simplify how the toml import was handled anyway. This is now fixed via #1103. |
This is now released as part of coverage 5.4. |
FWIW, no more Thanks for your excellent work, Mr Batchelder. |
This was referenced Mar 13, 2021
This was referenced May 21, 2021
This was referenced Jun 6, 2021
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
This is an extremely corner case with a very simple solution --I think.
Under edge circumstances, I got this warning "_opt_bblocal_var_buildworker_ports_build_ports_lang_python38/python38/work/Python-3.8.7/Modules/_decimal/libmpdec/context.c:55: warning: mpd_setminalloc: ignoring request to set MPD_MINALLOC a second time".
This warning ultimately causes an exception:
I do not really understand which is the cause of this warning (and the subsequent exception) in my code.
But I traced it to this piece of code in
tomlconfig.py
, line 32 (coverage 5.3.1):from coverage.optional import toml
.The issue is solved by removing this line and import
coverage.optional.toml
in the module scope --that is, movingfrom coverage.optional import toml
out of theTomlConfigParser.read()
method.To Reproduce
This is a very extreme corner case. I really try to write a simple example to reproduce it, but I am not able to re-create the bug. Sorry about this.
Basically, I am try to test an invoke task --http://www.pyinvoke.org/-- that runs tests itself. Part of running tests via the invoke task is checking their coverage and print it out. The issue emerges when
coverage.Coverage()
is called in the invoke task method.To make things even worse, the warning only appears when all project's tests --including the test that checks the invoke tasks-- are run via
python -m unittest discover ...
. (Indeed, not properunittest
but a module that customisesunittest
for sub-tests counting).I should mention that there is a
pyproject.toml
in the project.Quite complicated to reproduce.
Normally, I do not submit such kind of almost-impossible-to-reproduce bug. But I find that solution is quite simple in this case, so I feel that it is fine to share it with you. Sorry for burdening you.
What version of Python are you using?
Python 3.8.7 - macOS-10.14.6-x86_64-i386-64bit
What version of coverage.py are you using?
coverage 5.3.1
What versions of what packages do you have installed?
(Some relevant packages)
coverage==5.3.1
invoke==1.4.1
toml==0.10.2
Expected behavior
Do not raise any warning or exception related to toml configuration.
Additional context
Thank you.
The text was updated successfully, but these errors were encountered: