Title: dealloc and finalize_modules by youknowone · Pull Request #6934 · RustPython/RustPython · GitHub
Open Graph Title: dealloc and finalize_modules by youknowone · Pull Request #6934 · RustPython/RustPython
X Title: dealloc and finalize_modules by youknowone · Pull Request #6934 · RustPython/RustPython
Description: Replace the absence of module finalization during interpreter shutdown with a 5-phase algorithm matching pylifecycle.c finalize_modules(): Set special sys attributes to None, restore stdio Set all sys.modules values to None, collect module dicts Clear sys.modules dict Clear module dicts in reverse import order (2-pass _PyModule_ClearDict) Clear sys and builtins dicts last This ensures del methods are called during shutdown and modules are cleaned up in reverse import order without hardcoded module names. Summary by CodeRabbit New Features Added a staged VM shutdown that more thoroughly finalizes and clears modules to improve cleanup during exit. Bug Fixes Improved object deallocation and finalization flow to better handle destructors, weak references, and object lifecycle edge cases. Chores Updated spell-check dictionary to recognize an additional Python-related token. ✏️ Tip: You can customize this high-level summary in your review settings.
Open Graph Description: Replace the absence of module finalization during interpreter shutdown with a 5-phase algorithm matching pylifecycle.c finalize_modules(): Set special sys attributes to None, restore stdio Set all...
X Description: Replace the absence of module finalization during interpreter shutdown with a 5-phase algorithm matching pylifecycle.c finalize_modules(): Set special sys attributes to None, restore stdio Set all...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6934
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9294884e-72c6-2d84-8700-aa5664f37409 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8A4C:2DDB6E:810515:ABBDE9:6A5D8F0A |
| html-safe-nonce | 20915d297e33833937e11d08af32407677b608edd9a887f89e1979bd37c45661 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTRDOjJEREI2RTo4MTA1MTU6QUJCREU5OjZBNUQ4RjBBIiwidmlzaXRvcl9pZCI6IjQ2MzgyNzk3OTE5ODg4MDUzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0d43a36ace3fe71ce661724bf172d55a26de30aa0681dafdd1ab060d9b2765de |
| hovercard-subject-tag | pull_request:3232892370 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/6934/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | Replace the absence of module finalization during interpreter shutdown with a 5-phase algorithm matching pylifecycle.c finalize_modules(): Set special sys attributes to None, restore stdio Set all... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width