concurrent/futures/process.py: mp.util.debug is called, but mp.util is never imported
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
Description
Bug report
In Lib/concurrent/futures/process.py, mp.util.debug is called, but mp.util is never imported.
This leads to the following:
Exception ignored in: <function _ExecutorManagerThread.__init__.<locals>.weakref_cb at 0x----------->
Traceback (most recent call last):
File "python3.10/concurrent/futures/process.py", line 288, in weakref_cb
AttributeError: 'NoneType' object has no attribute 'util'
My environment is Python 3.10, but this bug exists in the latest cpython.
My impression is that this is relic debug code (but if it is not, non-working code is not helpful). I am about to make a PR removing this debug code.
- PR: gh-99369
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Lib/concurrent/futures/process.py and inspect the weakref callback around the reported mp.util.debug call. Review PR gh-99369 to understand the work already underway, then run the relevant concurrent.futures tests; done means the callback no longer raises the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100