Title: Fix test_import: import machinery, circular imports, and script shadowing by youknowone · Pull Request #7034 · RustPython/RustPython · GitHub
Open Graph Title: Fix test_import: import machinery, circular imports, and script shadowing by youknowone · Pull Request #7034 · RustPython/RustPython
X Title: Fix test_import: import machinery, circular imports, and script shadowing by youknowone · Pull Request #7034 · RustPython/RustPython
Description: Emit IMPORT_FROM instead of LOAD_ATTR for import a.b.c as m (compile.rs) Add "partially initialized module" error in module getattr for circular imports Add "cannot access submodule" error for initializing submodules Implement "consider renaming" script shadowing detection (module.rs, frame.rs) Detect when a user script shadows a stdlib or third-party module Compute original sys.path[0] from sys.argv[0] (like CPython's config->sys_path_0) Check sys.stdlib_module_names for stdlib module detection Respect safe_path setting Implement _imp._fix_co_filename to rewrite code object source_path in-place Add data parameter support to _imp.get_frozen_object with marshal deserialization Fix import_from error messages: check spec.has_location before using origin Set ImportError.path attribute on import failures Fix import_star error messages for non-str items in all and dict Always call builtins.import (remove sys.modules cache bypass in import_inner) Summary by CodeRabbit New Features Better support for importing dotted module paths with aliases. Additional frozen-module aliases so more built-in modules are discoverable. Import system improvements that make more encodings and submodules resolvable at startup. Bug Fixes Richer, more informative import error messages including module origin and stdlib shadowing hints. Improved handling of partially initialized modules and circular-import diagnostics. More robust handling of all during star imports and attribute export resolution.
Open Graph Description: Emit IMPORT_FROM instead of LOAD_ATTR for import a.b.c as m (compile.rs) Add "partially initialized module" error in module getattr for circular imports Add "cannot access submodule&...
X Description: Emit IMPORT_FROM instead of LOAD_ATTR for import a.b.c as m (compile.rs) Add "partially initialized module" error in module getattr for circular imports Add "cannot acces...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7034
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b5bdea98-4930-2d34-2f7b-c1de49ef4e98 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B2AE:2A4911:1322D7B:18D8B67:6A5C4387 |
| html-safe-nonce | 074b04fde6f1085d3a3842c1114ccd382180e158e0864ace5f2d05b2c9170c4d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkFFOjJBNDkxMToxMzIyRDdCOjE4RDhCNjc6NkE1QzQzODciLCJ2aXNpdG9yX2lkIjoiNDc2MDM5ODI3OTI4ODMwODYxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 224391432a19905bf72a02ad4546f83ffb4047a12e0af41fbd4aa730f2c231a8 |
| hovercard-subject-tag | pull_request:3257193482 |
| 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/7034/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 | Emit IMPORT_FROM instead of LOAD_ATTR for import a.b.c as m (compile.rs) Add "partially initialized module" error in module getattr for circular imports Add "cannot access submodule&... |
| 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