-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Azure Identity: AzureCliCredentials and AzureDeveloperCliCredential handle stderr may be None when executing subprocess #39176
Merged
xiangyan99
merged 5 commits into
Azure:main
from
jenshnielsen:azure_identity_handle_stderr_none
Jan 16, 2025
Merged
Azure Identity: AzureCliCredentials and AzureDeveloperCliCredential handle stderr may be None when executing subprocess #39176
xiangyan99
merged 5 commits into
Azure:main
from
jenshnielsen:azure_identity_handle_stderr_none
Jan 16, 2025
+33
−4
Conversation
This file contains 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
Thank you for your contribution @jenshnielsen! We will review the pull request and get back to you soon. |
API change check API changes are not detected in this pull request. |
fd69b67
to
92ab2e9
Compare
for AzureCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In AzureCliCredential._run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content.
add a test for error handling when AzureDeveloperCliCredential fails to capture stderr
for AzureDeveloperCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In _run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content.
add a test for error handling when AzureCliCredential execution fails to capture stderr
92ab2e9
to
9ff3a7c
Compare
jenshnielsen
commented
Jan 14, 2025
c27a12c
to
9568ced
Compare
xiangyan99
approved these changes
Jan 16, 2025
allenkim0129
pushed a commit
to allenkim0129/azure-sdk-for-python
that referenced
this pull request
Jan 27, 2025
…andle stderr may be None when executing subprocess (Azure#39176) * Azure Identity: Handle stderr may be None for AzureCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In AzureCliCredential._run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content. * AzureIdentity: AzureDeveloperCliCredential add a test for error handling when AzureDeveloperCliCredential fails to capture stderr * Azure Identity: Handle stderr may be None for AzureDeveloperCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In _run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content. * AzureIdentity: AzureCliCredential add a test for error handling when AzureCliCredential execution fails to capture stderr * Add changelog for 39176
l0lawrence
pushed a commit
to l0lawrence/azure-sdk-for-python
that referenced
this pull request
Feb 19, 2025
…andle stderr may be None when executing subprocess (Azure#39176) * Azure Identity: Handle stderr may be None for AzureCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In AzureCliCredential._run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content. * AzureIdentity: AzureDeveloperCliCredential add a test for error handling when AzureDeveloperCliCredential fails to capture stderr * Azure Identity: Handle stderr may be None for AzureDeveloperCliCredential According to the docs CredentialUnavailableError.stderr may be None if no output is captured. ``` Stderr output of the child process if it was captured by run(). Otherwise, None. ``` https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError In _run_command this is handled when propergating the error but was overlooked in other parts of the code. This pr fixes the code to ensure that the None case is handled before checking for str content. * AzureIdentity: AzureCliCredential add a test for error handling when AzureCliCredential execution fails to capture stderr * Add changelog for 39176
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Azure.Identity
Community Contribution
Community members are working on the issue
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
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.
Description
According to the docs
CredentialUnavailableError.stderr may be None
if no output is captured.
https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError
In AzureCliCredential._run_command (and similar in AzureDeveloperCliCredential) this is
handled when propagating the error
but was overlooked in other parts of the code.
This pr fixes the code to ensure that the None
case is handled before checking for str content.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines