scripts/update_schemastore: add text=True to git revision check_output calls#3523
Merged
dhruvmanila merged 6 commits intoMay 26, 2026
Conversation
Contributor
Author
|
The only remaining failure is a mdformat blank line issue caused by GitHub's web editor mangling the formatting. Happy for a maintainer to fix it directly or I can push a local fix if needed. |
dhruvmanila
approved these changes
May 26, 2026
dhruvmanila
left a comment
Member
There was a problem hiding this comment.
Thank you.
I'm going to remove the test file given that these are scripts and we usually don't write tests for it. I'm also updating the print call to use !r so that the quotes are present in the output.
Contributor
Author
|
Thank you for the review and for taking the time to clean things up! Totally understand the no-tests policy for scripts — good to know for future contributions. The !r approach is a neat solution. Appreciate you merging this! 🙏 |
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.
Summary
main()inscripts/update_schemastore.pycallscheck_outputtwice to readgit SHAs — once for the expected ruff submodule revision and once for the actual
HEAD of the submodule — but neither call passes
text=True. Without it,check_outputreturnsbytes, and when those values are interpolated into themismatch warning f-string the user sees raw bytes repr in their terminal:
instead of the intended:
The same
main()already usestext=Truecorrectly for thecurrent_shacall on line 81. This PR makes the two revision-check calls consistent with
that pattern.
Test Plan
Added
scripts/tests/test_update_schemastore.pywith a test that monkey-patchescheck_outputto return the mismatched-revision case, captures stdout, andasserts the output contains plain SHA strings without any
b'...'wrapper.The test fails against the original code and passes after the fix.