Code Monkey home page Code Monkey logo

Comments (4)

abravalheri avatar abravalheri commented on August 23, 2024

Hi @vsajip, thank you very much for opening the issue.

/cc @jaraco should we transfer this issue to the pypa/distutils repository?

from setuptools.

jaraco avatar jaraco commented on August 23, 2024

Perhaps, although setuptools.logging does the same thing:

logging.root.setLevel(level * 10)

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.

from setuptools.

vsajip avatar vsajip commented on August 23, 2024

The problem surfaced when I ran the unit tests for an old project (logutils) which uses distutils (it dates from around Python 3.2) - the tests ran fine on Python 3.10, but failed on 3.11 because the legacy code in setup.py called parse_command_line(), and this caused the root logger to have a different initial state than it does under 3.10 and older. (This old project uses python setup.py test to run the tests.)

I would have thought the solution should be to move the logic from parse_command_line() to wherever output is about to be done. I'm not sure whether in this case logging is being used to do normal program output, but if so, then that's not good practice, either. Use of the root logger should only be for simple single-file scripts - in all other cases, named loggers (and not the root) should be used to identify where a logging event is coming from, and to allow application writers or sysadmins to configure logging verbosity for that part of the system.

from setuptools.

owocado avatar owocado commented on August 23, 2024

so this is the culprit, I was scratching my forehead since a month why in my small project the root logger was set to logging.WARN state at startup each time and after doing painstaking debugging every now and then, I just realised today it started occuring ever since I updated setuptools last month from v65.6.0 to latest. It took me a while to find this issue. You guys should revert this change. The amount of debugging I have done to find the cause is insane and this bug is not pleasant to say the least.

This change was introduced in #3674 in case someone find that useful.

from setuptools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.