GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — objects: decode a byte mode before reading its digits by SashaMIT · Pull Request #2261 · gitpython-developers/GitPython

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

mode_str_to_int(b"100644") returned 1830740 (0o6767524). A byte is an int, so the digit 4 was read as 52. mode_str_to_int("100644") was already 0o100644. A byte string is decoded before the digits are read. b"120000" is 0o120000. 644 is still 0o644.

Test plan

  • pytest -o addopts= test/test_util.py::test_mode_str_to_int_accepts_bytes (passed; on tip the byte mode was 1830740)

Drafted with Grok 4.7. The code has not yet been reviewed by a human.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SashaMIT
objects: decode a byte mode before reading its digits
62266da
mode_str_to_int(b"100644") returned 1830740. A byte is an int, so the
digit 4 was read as 52. A text mode was already 0o100644.
@Byron
Byron requested a balanced review from Copilot October 1, 2026 12:05
Copilot started reviewing on behalf of Byron October 1, 2026 12:06
View session
Copilot AI reviewed Oct 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused fix correctly handles byte modes and includes adequate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes byte-based Git mode parsing by decoding bytes before converting octal digits.

Changes:

  • Decode byte modes as ASCII.
  • Add regression coverage for string and byte modes.
File Description
git/​objects/​util.py Corrects byte mode conversion.
test/​test_util.py Adds regression tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron

Byron commented Oct 1, 2026

Copy link
Copy Markdown
Member

Thanks a lot!

SashaMIT reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Byron
Byron merged commit bda18e0 into gitpython-developers:main Oct 1, 2026
47 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@SashaMIT @Byron
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.