python / python/cpython

concurrent/futures/process.py: mp.util.debug is called, but mp.util is never imported

Open
#99,368 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-bug
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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.