-
Notifications
You must be signed in to change notification settings - Fork 3.2k
patch open function to convert crlf to lf #44325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Pull request overview
This PR implements a runtime solution for handling CRLF to LF line ending conversions in test files, replacing the previous .gitattributes-based approach. The change ensures consistent binary representation of test assets across Windows and Linux platforms during test execution.
Key Changes:
- Adds a patched
open()function that automatically converts CRLF to LF for text files opened in binary read mode - Removes
.gitattributesfile that previously enforced LF line endings at the git level - Updates test assets tag to reflect the new approach
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tests/samples/test_samples.py | Implements ConvertedFileWrapper class and _patched_open() method to handle CRLF-to-LF conversion at runtime |
| sdk/ai/azure-ai-projects/samples/agents/assets/.gitattributes | Removes git-level line ending enforcement for test assets |
| sdk/ai/azure-ai-projects/assets.json | Updates assets repository tag |
05da95c to
bd42f93
Compare
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines