pypa / pypa/setuptools

_distutils.dist.Distribution.parse_command_line() wrongly causes unexpected change to global state

Open
#4,190 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

This line in the eponymous method:
https://github.com/pypa/setuptools/blob/b000f0cb66207cc13860c4c0b425cfe82119837b/setuptools/_distutils/dist.py#L469
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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at setuptools/_distutils/dist.py:469 in Distribution.parse_command_line(), as identified in the issue. Verify that parsing the command line no longer changes the root logger, then run the relevant existing test suite to confirm the behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.