Title: Re-Loading the sys or builtins Modules is Problematic · Issue #102660 · python/cpython · GitHub
Open Graph Title: Re-Loading the sys or builtins Modules is Problematic · Issue #102660 · python/cpython
X Title: Re-Loading the sys or builtins Modules is Problematic · Issue #102660 · python/cpython
Description: The sys and builtins modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the data they expose is fundamental to the inte...
Open Graph Description: The sys and builtins modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the dat...
X Description: The sys and builtins modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the...
Opengraph URL: https://github.com/python/cpython/issues/102660
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Re-Loading the sys or builtins Modules is Problematic","articleBody":"The `sys` and `builtins` modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the data they expose is fundamental to the interpreter. Reloading the modules doesn't make much sense.\r\n\r\nThe simplest thing to do is to disallow manually loading them (e.g. via the loader). At the very least we should handle m_copy for these modules carefully. (This came up while working on gh-101660.)\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102661\n* gh-102744\n* gh-103257\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2023-03-13T21:35:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/102660/cpython/issues/102660"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e096a959-3930-60dc-c70a-fe4bbbbecc37 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A952:1E0146:FE3A91:1540BEA:69699273 |
| html-safe-nonce | 3c9c32398f5c508c2f3ad9d72ad33c97277ee235bbb68e4d7e31ce6a2dbf57f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTUyOjFFMDE0NjpGRTNBOTE6MTU0MEJFQTo2OTY5OTI3MyIsInZpc2l0b3JfaWQiOiI1NzE0MzI4MzA1NDY4NTQzNjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e642f20d5e1c22142d6a80cd481d5f040029ddc7db25ade33fe37d6c622ece1f |
| hovercard-subject-tag | issue:1622302411 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/102660/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a00b90bf1f9078e426059c5ef8cfb36163d6d4840be4057fbbc9e11afc184f7b/python/cpython/issues/102660 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a00b90bf1f9078e426059c5ef8cfb36163d6d4840be4057fbbc9e11afc184f7b/python/cpython/issues/102660 |
| og:image:alt | The sys and builtins modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the dat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width