Skip to content

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

@gucci-on-fleek

Description

@gucci-on-fleek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions