-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Conditionally quote env vars #7071
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
Conditionally quote env vars #7071
Conversation
123ac0f to
bcb2aef
Compare
bcb2aef to
ec0e2e1
Compare
|
This fix avoided some errors. However, there is still error with variable containing double quotes. after quoting, it will become then, in bash will export the which is no longer a valid JSON string. Shall we use shlex.quote() instead? |
|
@loadams cpu-torch-latest ci stuck, please rerun |
|
@saurabhkoshatwar, thanks for the PR. Is it possible to add a unit test here? |
Signed-off-by: Saurabh <saurabhkoshatwar1996@gmail.com>
496fd99 to
af07f62
Compare
af07f62 to
5262524
Compare
5262524 to
19b75eb
Compare
|
Thanks @saurabhkoshatwar, will review. Curious on your thoughts on @qiuosier's comment? Also can you take a look at the formatting errors? |
Signed-off-by: Saurabh Koshatwar <saurabhkoshatwar1996@gmail.com>
…ar/DeepSpeed into bugfix/env_export
@qiuosier - would you be willing to submit a PR with a suggestion for resolving this? Also do you have a use case where an envvar is a json string that we can add as a test case? Or would you be willing to open an issue for this? |
I’m also curious about the use case where an envvar is a JSON string. @qiuosier, please share—I can update it in this PR. |
@saurabhkoshatwar, I think it is fine for additional features to come through a separate PR. I feel this PR provides enough benefits as is. |
Resolves deepspeedai#6997 This PR conditionally quotes environment variable values—only wrapping those containing special characters (like parentheses) that could trigger bash errors. Safe values remain unquoted. --------- Signed-off-by: Saurabh <saurabhkoshatwar1996@gmail.com> Signed-off-by: Saurabh Koshatwar <saurabhkoshatwar1996@gmail.com> Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
Resolves #6997 This PR conditionally quotes environment variable values—only wrapping those containing special characters (like parentheses) that could trigger bash errors. Safe values remain unquoted. --------- Signed-off-by: Saurabh <saurabhkoshatwar1996@gmail.com> Signed-off-by: Saurabh Koshatwar <saurabhkoshatwar1996@gmail.com> Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com> Signed-off-by: Logan Adams <loadams@microsoft.com>
Resolves deepspeedai#6997 This PR conditionally quotes environment variable values—only wrapping those containing special characters (like parentheses) that could trigger bash errors. Safe values remain unquoted. --------- Signed-off-by: Saurabh <saurabhkoshatwar1996@gmail.com> Signed-off-by: Saurabh Koshatwar <saurabhkoshatwar1996@gmail.com> Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com> Signed-off-by: yisheng <yi.sheng@intel.com>
Resolves #6997
This PR conditionally quotes environment variable values—only wrapping those containing special characters (like parentheses) that could trigger bash errors. Safe values remain unquoted.