Repository navigation
fix/issue 5897 crlf sm train - #6088
Conversation
15e650b to
fa7b7aa
Compare
FrameworkProcessor._package_code read and deleted its temporary tar.gz while the NamedTemporaryFile handle was still open. On Windows that raises PermissionError (WinError 32) because the file is still held by the open handle. Close the handle first, read the archive in a with-open context, and unlink it in a finally block so the temp file is removed on every path. The LF line-ending fixes for sm_train.sh and the repack launcher that originally shared this branch are covered by open PRs #6255 / #6088 (sm_train.sh) and #6313 (repack launcher), so they are not repeated here. Fixes #5873 --- X-AI-Prompt: Fix S-effort PySDK V3 bugs, windows theme X-AI-Tool: Kiro Co-authored-by: rsareddy0329 <rsareddy0329@gmail.com>
|
Hi everyone, Quick follow-up on this PR concerning fix/issue 5897 crlf sm train in aws/sagemaker-python-sdk. Working on Amazon SageMaker Python SDK machine learning and model deployment pipelines has been a great experience, and I am very keen to continue contributing to aws/sagemaker-python-sdk. I am also open to collaborating on a contract/freelance basis, discussing full-time opportunities, or joining the organization/team. You can view my background and other open-source contributions at https://github.com/wasim-builds. |
|
Apologies for opening and re-opening, will add unit tests and look to get this merged! |
Adds the unit test from aws#5907 plus an OS-independent regression guard. The byte-level check from aws#5907 (no CRLF in the written sm_train.sh) only fails on Windows, since POSIX text-mode open() never translates \n. CI runs on Linux, so that test passes with or without the fix. The second test inspects the open() call for sm_train.sh and asserts newline="\n", mirroring the approach merged in aws#6313 for the mlops repack launcher, so the guard holds on any host OS.
|
Codebuild succeeded, tests pass: https://tiny.amazon.com/kmwe9wt0/usweconsawsamazcodecode7296 |
|
Claude finished @mohamedzeidan2021's task in 44s —— View job Code Review — PR #6088 (CRLF → LF for
|
Fixes #5897
Problem
ModelTrainerwrites files with platform-default line endings, causing CRLF/LF inconsistencies on Windows.Fix
Explicitly normalize line endings to LF when writing training artifacts.
Scope
Single-line change in
sagemaker-train/src/sagemaker/train/model_trainer.py.Verification
Training artifacts now have consistent LF line endings regardless of OS.