Conversation
…OWNERS files Fixes #378 ## What Normalize CODEOWNERS file contents to bytes before processing, so both the normal path (Contents object with .decoded) and the large-file path (raw bytes from blob().decode_content()) use the same type downstream. ## Why When a CODEOWNERS file is large enough that the GitHub API returns null content, the code fetches it via blob().decode_content() which returns raw bytes. The code then called .decoded on that bytes object, crashing with "'bytes' object has no attribute 'decoded'" and preventing PR creation for user removal. ## Notes - The isinstance check in get_usernames_from_codeowners handles both bytes lines and str lines, since the function now accepts raw bytes or str directly - Existing tests updated to pass bytes/str directly instead of mocking .decoded, matching the new contract Signed-off-by: jmeridth <jmeridth@gmail.com>
zkoppert
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Proposed Changes
Fixes #378
What
Normalize CODEOWNERS file contents to bytes before processing, so both the normal path (Contents object with
.decoded) and the large-file path (raw bytes fromblob().decode_content()) use the same type downstream.Why
When a CODEOWNERS file is large enough that the GitHub API returns null content, the code fetches it via
blob().decode_content()which returns raw bytes. The code then called.decodedon that bytes object, crashing with'bytes' object has no attribute 'decoded'and preventing PR creation for user removal.Notes
isinstancecheck inget_usernames_from_codeownershandles both bytes lines and str lines, since the function now accepts raw bytes or str directly.decoded, matching the new contractTesting
test_get_usernames_from_codeowners_with_raw_bytesthat passes rawbytes(simulating the large file path) and verifies usernames are extracted correctlyget_usernames_from_codeownersinstead of using a mock with.decodedReadiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing