-
-
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
_distutils.dist.Distribution.parse_command_line() wrongly causes unexpected change to global state #4190
Comments
Perhaps, although setuptools.logging does the same thing: setuptools/setuptools/logging.py Line 37 in b000f0c
So we should probably handle the issue here first. More importantly, Setuptools and distutils are getting out of the business of acting as a library, except as a backend for builders. @vsajip - what's your use-case for using Setuptools as a library? Under what conditions does the current implementation cause problems? This behavior goes back decades, so it'll likely be difficult to disentangle, especially with the dual-implementation nature of setuptools+distutils. |
The problem surfaced when I ran the unit tests for an old project ( I would have thought the solution should be to move the logic from |
so this is the culprit, I was scratching my forehead since a month why in my small project the root logger was set to This change was introduced in #3674 in case someone find that useful. |
This line in the eponymous method:
setuptools/setuptools/_distutils/dist.py
Line 469 in b000f0c
causes a global change to the root logger. This is unexpected and unwanted when being used as a library. Changes to logging configuration must not in general be made by a library, only by application code. Parsing a command line can be done without running it, and this shouldn't change the root logger.
The text was updated successfully, but these errors were encountered: