fix: requirements.txt checksum mismatch on Windows - #856
Merged
Merged
Conversation
|
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
allows prerelease tests to pass
marcosnav
requested changes
Sep 30, 2026
marcosnav
left a comment
Contributor
There was a problem hiding this comment.
While chatting with the 🤖 on this one, it seems that rsconnect still gets the CRLF case wrong.
Tests call detect_environment() directly and skip main() and pass. But, main() in rsconnect/subprocesses/inspect_environment.py runs every line through strip_ref().
That calls .strip() on each line, which removes the \r that the newline="" change now keeps.
I verified this by changing the tests slightly to go through the subprocess. Calling Environment.create_python_environment(str(tmp_path)) catches this.
Contributor
Author
|
ahh good catch, thanks @marcosnav, I will update |
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.
Intent
On Windows,
write-manifestwroterequirements.txtin text mode, which changed\nto\r\n. This resulted in a file whose checksum did not match the one that rsconnect calculated, which could cause deployment to fail. This fixes it by writing the file as bytes.Fixes #855
Type of Change
Approach
to_bytes, the same functionbuffer_checksumuses, so the file and the checksum always match.newline=""so that CRLF line endings stay in the contents. Before, a CRLF file got an LF checksum on all platforms. This was the cause of write-manifest on Windows creates an inaccurate checksum #429.Automated Tests
The new
test_bundle.pytests patchopeninrsconnect.bundleto use Windows text-mode defaults, so they fail on any OS without the fix.Directions for Reviewers
Checklist
rsconnect-python-tests-at-nightworkflow in Connect against this feature branch.