-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ensure log level is set correctly (and setuptools.logging.set_threshold
is called)
#3042
Conversation
For some reason `distutils.log` module is getting cached in `distutils.dist` and then loaded again when we have the opportunity to patch it. This implies: id(distutils.log) != id(distutils.dist.log). We need to make sure the same module object is used everywhere.
@abravalheri Please see #3035. I believe the issue affects any module with a |
Thank you very much @dalcinl for the pointer. Indeed that might be problematic (if we find a reproduction for the other modules). Fortunately the only thing being monkey patched in the |
Regarding the root cause of the problem in #3035, the only place in the @jaraco might be the best person to advise on that. |
I'm unsure about #3035 but as that report is invalid, I'll advise to disregard its concerns for now and focus on the issue and fix at hand, which looks sound. If there are additional concerns, we can address those if/when expressed by a valid issue. |
@jaraco, I managed to write some tests to verify the duplicated import behaviour. I will follow your suggestion and leave the problem as it is for now until a valid issue is created. (I will just include the test cases, because it is something that can be useful in the future). |
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
86982b6
to
711b526
Compare
UPDATE: I will submit the new tests as a separated PR (#3046), so we can focus on the logging problem. |
Motivation
For some reason
distutils.log
module is getting cached indistutils.dist
and then loaded again when we have the opportunity to patch it.This implies:
id(distutils.log) != id(distutils.dist.log)
, and therefore the functionsetuptools.logging.set_threshold
never gets called (instead the old versionsetuptools._distutils.log.set_threshold
is used).Summary of changes
distutils.dist.log
with the "correct" patched module object.Closes #3038
Pull Request Checklist
changelog.d/
.(See documentation for details)