Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Frozen modules were populating __origname__ with the import alias rather than the original frozen name, so importlib bootstrap logic could not resolve accurate filenames.

  • Encode/decode origin names in frozen module metadata so the original name is preserved alongside the code and package flag.
  • Wire import_frozen and _imp.find_frozen to expose the stored origname__ to Python, including aliases for _frozen_importlib and _frozen_importlib_external.
  • Add regression coverage to ensure __origname__ reflects the correct bootstrap names.

Example:

let module = import::import_frozen(vm, "_frozen_importlib")?;
assert_eq!(
    module.get_attr("__origname__", vm)?.try_into_value::<PyStrRef>(vm)?.as_str(),
    "importlib._bootstrap"
);
Original prompt

This section details on the original issue you should resolve

<issue_title>Add proper origname to frozen module</issue_title>
<issue_description>## Feature

#4559 added __origname__ property but it doesn't contain actual origname.
</issue_description>

<agent_instructions>Correctly implement one. Reference for previous work: f53c686
</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Copilot AI changed the title [WIP] Add proper __origname__ to frozen module Add correct __origname__ metadata for frozen modules Dec 25, 2025
Copilot AI requested a review from youknowone December 25, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add proper __origname__ to frozen module

2 participants