RustPython / RustPython/RustPython

Module destruction is missing

Open
#3,778 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug C-compat
Dominant language
Rust
Stars
22.4k
Forks
1.5k
Avg merge
16h 33m
Merged PRs (30d)
165

Description

Feature

https://github.com/python/cpython/blob/5442561c1a094b68900198bade616da9ed509ac8/Lib/test/test_sys.py#L963-L982
test_sys::SysModuleTest.test_is_finalizing

In TC, AtExit.__del__ is not invoked. Because ref = AtExit() is a module attribute, RustPython must implement module destruction to invoke it.

Found during work on #3776

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 referenced CPython test, test_sys::SysModuleTest.test_is_finalizing, then trace RustPython's module teardown behavior. Confirm how module attributes are destroyed and verify that AtExit.del is invoked for the module attribute, with equivalent coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.