Skip to content

gh-149394: Document that atexit functions are not called when os.exec*() is called#149395

Open
gucci-on-fleek wants to merge 1 commit intopython:mainfrom
gucci-on-fleek:atexit-osexec-docs
Open

gh-149394: Document that atexit functions are not called when os.exec*() is called#149395
gucci-on-fleek wants to merge 1 commit intopython:mainfrom
gucci-on-fleek:atexit-osexec-docs

Conversation

@gucci-on-fleek
Copy link
Copy Markdown

@gucci-on-fleek gucci-on-fleek commented May 5, 2026

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, so add os.exec*() to the list of cases where atexit functions are not called.

Fixes #149394.

…s.exec*() is called

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, so add
os.exec*() to the list of cases where atexit functions are not called.

Fixes python#149394.
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 5, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32536550 | 📁 Comparing ac0ad33 against main (5dd2161)

  🔍 Preview build  

1 file changed
± library/atexit.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

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

1 participant