python / python/cpython

`atexit` functions are not called when `os.exec*()` is called

Open
#149,394 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

Running the following test file

#!/usr/bin/env python3
import atexit
import os
import sys

atexit.register(print, "atexit callback called")
# sys.exit()
os.execl("/usr/bin/true", "true")

does not print a message to the console in Python 3.14, but os.exec*() is not included in the list of cases where atexit functions are not called. The atexit module documentation should be updated to also mention os.exec*().

Linked PRs
  • gh-149395

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 the atexit module documentation and review the linked list of cases where atexit functions are not called. Update that list to mention os.exec*(), then verify that the documentation accurately reflects the provided executable example; gh-149395 is linked as the related pull request.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.