Skip to content

Various bugfixes#43

Merged
jeFF0Falltrades merged 1 commit intomasterfrom
feb_26_bug_fixes
Feb 19, 2026
Merged

Various bugfixes#43
jeFF0Falltrades merged 1 commit intomasterfrom
feb_26_bug_fixes

Conversation

@jeFF0Falltrades
Copy link
Owner

Because I have been running experiments with Claude Code, I threw it at RKP to identify any high-priority fixes, and it found what look to be some valid changes:

Summary

  • Fix startswith() TypeError crash in custom_attribute_from_type() — multiple prefix strings were passed as separate positional args instead of a tuple
  • Fix MACO extractor passing yara Rules object as file_path instead of yara_rule, which silently skipped YARA family detection and left yara_possible_family as an empty string
  • Fix unclosed file handle in MACO extractor class-level yara_rule attribute — replaced open().read() with Path.read_text()
  • Add None guard in user_string_from_rva() to raise a descriptive ConfigParserException instead of an opaque AttributeError
  • Fix SpecialFolderConfigItem._derive_item_value() returning None for unrecognized folder IDs — now returns "UnknownFolder(id)" to match the str return type
  • Remove unused from typing import Optional import in MACO module

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jeFF0Falltrades, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a series of targeted bug fixes aimed at improving the robustness and reliability of the Rat King Parser. The changes address several critical issues, including type errors, incorrect argument passing, resource management, and error handling, ensuring more stable and predictable behavior across various parsing operations. These improvements were identified through experimental analysis, leading to a more resilient codebase.

Highlights

  • TypeError Fix: Resolved a TypeError crash in custom_attribute_from_type() by correctly passing multiple prefix strings as a tuple to startswith().
  • MACO Extractor YARA Fix: Corrected the MACO extractor to properly pass the YARA Rules object as yara_rule instead of file_path, ensuring YARA family detection functions as intended.
  • File Handle Management: Addressed an unclosed file handle in the MACO extractor's class-level yara_rule attribute by replacing open().read() with Path.read_text().
  • Error Handling Improvement: Introduced a None guard in user_string_from_rva() to raise a descriptive ConfigParserException instead of an opaque AttributeError.
  • Special Folder ID Handling: Fixed SpecialFolderConfigItem._derive_item_value() to return a formatted string like 'UnknownFolder(id)' for unrecognized folder IDs, aligning with its str return type.
  • Code Cleanup: Removed an unused from typing import Optional import in the MACO module.
  • Version Update: Bumped the package version from 4.2.2 to 4.2.3.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/rat_king_parser/_version.py
    • Bumped the package version from 4.2.2 to 4.2.3.
  • src/rat_king_parser/config_parser/utils/config_item.py
    • Fixed SpecialFolderConfigItem._derive_item_value() to return a formatted string for unrecognized folder IDs, ensuring consistency with the str return type.
  • src/rat_king_parser/config_parser/utils/dotnetpe_payload.py
    • Implemented a None guard in user_string_from_rva() to raise a ConfigParserException when a user string is not found, preventing AttributeError.
    • Corrected the startswith() method call in custom_attribute_from_type() to pass multiple prefixes as a tuple, resolving a potential TypeError.
  • src/rat_king_parser/extern/maco/rkp_maco.py
    • Removed the unused from typing import Optional import.
    • Updated the yara_rule attribute to use Path.read_text() for file handling, preventing unclosed file handles.
    • Corrected the RATConfigParser instantiation to pass the YARA rules object via the yara_rule keyword argument instead of as a positional argument.
    • Standardized Optional type hints to typing.Optional for consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request provides a good set of bug fixes that improve the overall quality and robustness of the code. The changes correctly address a TypeError in startswith usage, prevent a potential AttributeError with a None check, fix a resource leak by using Path.read_text(), and resolve an issue with incorrect argument passing to RATConfigParser. The return type of SpecialFolderConfigItem._derive_item_value is also corrected to align with its type hint. All the changes are clear and correct. I have no further suggestions.

@jeFF0Falltrades jeFF0Falltrades merged commit e9c1ea3 into master Feb 19, 2026
2 checks passed
@jeFF0Falltrades jeFF0Falltrades deleted the feb_26_bug_fixes branch February 19, 2026 02:25
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.

1 participant